I'm making a login program to get the usernames and passwords from a mysql database but i get Runtime Error 424.
The yellow line is what Visual Basic said is causing the problem.Code:Private Sub cmdLogin_Click() Dim SQL As String Dim conn As ADODB.Connection Set conn = New ADODB.Connection Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset conn.CursorLocation = adUseClient conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & "SERVER=ip;" & "DATABASE=dbname;" & "UID=username;" & "PWD=password;" & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384 conn.Open conn.ConnectionString SQL = "SELECT * FROM authorized WHERE username = '" & txtUsername.Text & "' AND password = '" & txtPassword.Text & "'" rs.Open SQL, conn, adOpenStatic, adLockReadOnly




Reply With Quote