Q

Accessing remote MySQL DBs in VB6

MySQL expert Scott Noyes recommends downloading ODBC to connect within your VB project.

I'm looking for a way to access and control remote MySQL DBs in VB6 using either sockets or a free VB control. Do you have any examples of how to manipulate them?

MySQL supports ODBC. Download the ODBC drivers. In your VB project, add the Microsoft Remote Data Object and connect....

Your connection code might look something like this:

Dim cnMySql As New rdoConnection
cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = "DRIVER={MySQL ODBC 3.51 Driver};" & _
 "SERVER=yourHostName;PORT=3306;" & _
 "DATABASE=dbName;" & _
 "UID=yourUserName;PWD=yourPassword;" & _
 "OPTION=3;"
Check the values for the OPTION parameter.
This was last published in September 2006

Dig Deeper on Open source databases

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

SearchServerVirtualization

SearchCloudComputing

SearchEnterpriseDesktop

Close