Results 1 to 2 of 2

Thread: What is Wrong Here

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    south africa
    Posts
    16

    Post

    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

  2. #2
    Addicted Member
    Join Date
    Feb 2000
    Posts
    224

    Post

    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
  •  



Click Here to Expand Forum to Full Width