ciao, per controllare il login degli utenti uso questa funzione
codice:
Function checkLogin(u As String, p As String) As Boolean
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim q As String
checkLogin = False
Set db = CurrentDb
q = "select * from [user] where username = '" & u & "' and password = '" & p & "';"
'should execute query
Set rst = db.OpenRecordset(q, dbOpenDynaset) 'qui mi da errore: run-time error 3061. too few parameters. expected 1.
With rst
Do While Not .EOF
checkLogin = True
.MoveNext
Loop
End With
db.Close
'if there is a result checkLogin = true
End Function
cosa sbaglio?