|
-
Feb 14th, 2000, 07:52 PM
#1
Thread Starter
Junior Member
I am trying to validate the username and password at logon.I am doing this by connecting to an access database for usuing the data control.
This is the code I used, and on the Insert statement it gives me an ERROR.
Private Sub cmdOK_Click()
Dim username As String
Dim password As String
Data1.RecordSource = " SELECT Password From Advo_Details where Password = " '" & txtPassword & "'"
Insert Into("password")
Values (txtPassword)
If txtPassword = "password" Then
frmSearch.Show
frmSearch.Show
Else
MsgBox "Credentials provided are incorrect,Please retry!", vbOKOnly, "Log in ERROR"
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
End If
End If
End Sub
-
Feb 14th, 2000, 10:00 PM
#2
Addicted Member
Password is a string variable u have declared
u cannot use it within quotes :
Instead of ...
If txtPassword = "password" Then
try ...
If txtPassword = password Then
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|