i have problem when i make a login for a project in VB
i linked the dbase with the vb using the adodc and test connection and made sure that every thing is ok and matched and i used it in old project but
the problem is even if the password is wrong they take me to the next page(form)
this is screen shot + sample of the code for the command button
if there is a easy way for login connecting for the database pleae help me
![Name: form1.png
Views: 73
Size: 9.4 KB]()
i linked the dbase with the vb using the adodc and test connection and made sure that every thing is ok and matched and i used it in old project but
the problem is even if the password is wrong they take me to the next page(form)
this is screen shot + sample of the code for the command button
if there is a easy way for login connecting for the database pleae help me
HTML Code:
Private Sub Command2_Click()
Dim strName As String
Dim strPass As String
Dim pesan As String 'pesan is Indonesian and it is the same with Message in english
UsrData.Refresh
strName = txtUsr.Text
strPass = txtPwd.Text
Do Until UsrData.Recordset.EOF
If UsrData.Recordset.Fields("UserName").Value = strName And UsrData.Recordset.Fields("Password").Value = strPass Then
Me.Hide
Form5.Show 'if the login succeed then form that contain employee info shown
Exit Sub
Else
UsrData.Recordset.MoveNext
End If
Loop
pesan = MsgBox("Invalid password, try again!", vbOKCancel, UnderstandingWhatIs)
If (pesan = 1) Then
Form3.Show
txtUsr.Text = ""
txtPwd.Text = ""
Else
End
End If
End Sub