Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Option Explicit

Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()
    'set the global var to false
    'to denote a failed login
    LoginSucceeded = False
    Me.Hide
End Sub

Private Sub cmdOK_Click()

    rs.Open "SELECT * FROM Member ", con, adOpenDynamic, adLockReadOnly

    While Not rs.EOF
    If rs!MemberID = Val(txtUserID) Then

    'check for correct password'

    If rs!Pass = txtPassword Then

    'place code to here to pass the '
    'success to the calling sub'
    'setting a global var is the easiest'

    LoginSucceeded = True
    frmMENU.Show
    Me.Hide
    con.Close
    Exit Sub

    Else

    MsgBox "Invalid Password, try again!", , "Login"
    txtPassword.SetFocus
    SendKeys "{Home}+{End}"

    End If
    End If

    rs.MoveNext
    Wend
End Sub

Private Sub Form_Load()
 Call loadcon
End Sub


What I have tried:

rs open is the problem in runtime error 3705
Posted
Updated 12-Apr-22 16:54pm
v2
Comments
0x01AA 12-Apr-22 13:24pm    
Maybe you are in mind to explain in more details?
Maybe rs.Open is the problem when you do it mor than one time? If this is the case something like rs.Close before open could help.
Vasanthan A9UCP078 13-Apr-22 8:39am    
not working
0x01AA 13-Apr-22 8:59am    
Same error?
CHill60 12-Apr-22 13:42pm    
Which line throws the error? And that is a mighty strange way to check for ids - use a parameterized query to load just the record for that id rather than stepping through them one by one.
Maciej Los 14-Apr-22 15:13pm    
Not enough information! For example the body of loadcon procedure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900