Results 1 to 8 of 8

Thread: [RESOLVED] Runtime Error 424

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2007
    Posts
    18

    Resolved [RESOLVED] Runtime Error 424

    I'm making a login program to get the usernames and passwords from a mysql database but i get Runtime Error 424.

    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
    The yellow line is what Visual Basic said is causing the problem.
    Last edited by tipsyhitman; Aug 25th, 2007 at 05:06 PM. Reason: Clean code up

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