|
-
Apr 2nd, 2000, 04:06 PM
#1
Thread Starter
Hyperactive Member
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.
-
Apr 3rd, 2000, 01:03 AM
#2
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|