Results 1 to 1 of 1

Thread: [SELF RESOLVED] string problem

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    [SELF RESOLVED] string problem

    can someone please tell me whats wrong with my conn.ConnectionString
    VB Code:
    1. Private Sub cmdDB_Click()
    2.     Set conn = New ADODB.Connection
    3.     Dim strSvr As String
    4.     Dim strUid As String
    5.     Dim strPwd As String
    6.    
    7.     strSvr = txtIP.Text
    8.     strUid = txtUsername.Text
    9.     strPwd = txtPassword.Text
    10.    
    11.     conn.CursorLocation = adUseClient
    12.     conn.ConnectionString = "DRIVER={MYSQL ODBC 3.51 Driver}; " & _
    13.                             "SERVER=" & strSvr [color=red] & ";" [/color]& _
    14.                             "UID=" & strUid [color=red] & ";"[/color] & _
    15.                             "PWD=" & strPwd [color=red] & ";"[/color] & _
    16.                             "OPTIONS=" & 1 + 2 + 8 + 32 + 2048 + 16384
    17.        
    18.     conn.Open conn.ConnectionString
    19.     CreateDB
    20.     DoEvents
    21.     CreateTable
    22.  
    23.     cmdDB.Enabled = False
    24.     txtIP.Text = ""
    25.     txtUsername.Text = ""
    26.     txtPassword.Text = ""
    27.     txtIP.SetFocus
    28. End Sub

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