Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21192

Login-Logout

$
0
0
Can someone help me.I'm having trouble with my time out.The log out is connected to Time_out,but every time the user log's out, it keeps replacing the 1st row in database.

Here is my Login button it works.
Private Sub cmdLogin_Click()
Adodc1.RecordSource = "SELECT * FROM guest WHERE UserName ='" + Text1.Text + "'"
Adodc1.Refresh
If (Adodc1.Recordset.EOF = False) Then
If Text4.Text <> "" Then
If (txtPassword.Text = Adodc1.Recordset.Fields("Password")) Then

Adodc1.Recordset.Fields("Timein") = Time
Adodc1.Recordset.Fields("Date") = date
Adodc1.Recordset.Update

MsgBox ("Login Successful"), vbInformation, "Clinic Sytem"
Unload Me
frmmainguest.Show
Else
MsgBox ("Login Failure. Incorrect Password"), vbExclamation, "Clinic Sytem"
End If
Else
Text4.Text = MsgBox("All Fields are required", vbExclamation, "Clinic System")
Text4.Text = ""
End If
Else
MsgBox ("Login Failure. Username does not exist."), vbExclamation, "Clinic System"
End If

---------------------------
Then this is my logout- i'm having a problem with this.

Private Sub cmdLogout_Click()
With Adodc1
If Text1.Text = "guest" Then
Adodc1.Recordset.Fields("Timeout") = Time
Adodc1.Recordset.Update
End If

Viewing all articles
Browse latest Browse all 21192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>