Results 1 to 2 of 2

Thread: VB & MySQL

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    Hi,

    i need to connect vb to mysql. Ive got the required drivers. Is it possible to connect to mysql from VB itself(if so, does the syntax of the SQL statements change?) or do i have to use Access as an intermediate database? Can anyone help me out here?

    Thanks.

  2. #2
    New Member
    Join Date
    Mar 2000
    Posts
    12
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim strSQL as String

    '------------------------------------------------
    'establish connection string to MYSQL database
    '------------------------------------------------
    cn.Open "Provider=MSDASQL;Driver=MySQL;Data Source=[your datasource name];Database=[name of database];Server=[IP address where your MySQL database resides];UID=[username];PWD=[password];PORT=3306;FLAG=1;"

    strSQL="Select FNAME, LNAME from Users"
    rs.Open strSQL, cn, adOpenStatic, adLockOptimistic

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