|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Cannot Access table with ADO
Well I have have a table userlist and a function searchuser() und when the username and password entered matches with the any of record in table userlist, the function set the value to true. I am however getting problems in accessing the table because i get an error Username or password invalid, am i doing something wrong in opening recordset or is there problem in find methods? need your ideas to solve this problem.
Function searchuser() As Integer Dim user%Dim Parent% Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim criteria As String Set conn = CurrentProject.Connection Set rs= New ADODB.Recordset rs.Open _ "SELECT * FROM Userlist", _ conn, adOpenDynamic, adLockOptimistic criteria = "[USER] = """ & Forms![Login]!USER & """" ' FindFirst implementation rs.Find criteria, 0, adSearchForward, 1 If rs.EOF = False Then If rs!Password = Forms![Login]!Password Then loc_user_ID= rs![ID] dummy = True Else ' search next user Do ' FindNext Implementation rs.Find criteria, adSearchForward, 0 If rs.EOF = False Then If rs!Password = Forms![Login]!Password Then loc_user_ID = rs![ID] dummy = True Exit Do End If End If Loop While rs.EOF = False End If Else ' no record found dummy = False End If curr_user = Forms![Login]!USER rs.Close conn.Close ..... |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Cannot Access table with ADO |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|