Hi everyone , I am doing a log in& registration form. And i am using a adodb connection. can someone pls tell me what is wrong with my code on the rst.open part, and what should i replace. Im trying to call the password from ms access and suddenly there is a COMExceptionwasUnhandled appearing and it says .. " [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Username ='regina where Password =asdfghjkl". "
How can i resolve this problem? thank you very much!
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles SignLink.LinkClicked
cnn.Open("DBQ=" & Application.StartupPath & "\InventoryDatabase.accdb;Driver={Microsoft Access Driver (*.mdb, *.accdb)};uid=;pwd=;")
rst.Open("select * from Register where Username ='" & TextBox1.Text & " where Password ='" & TextBox2.Text & "'", cnn, 1, 3)
If rst.EOF Then
MsgBox("Invalid Username or Password!")
TextBox1.Clear()
TextBox2.Clear()
TextBox1.Focus()
Else
main.Show()
Me.Hide()
End If
rst.Close()
End Sub