Connect mysql with vba

V

vbaNOOB

Hi,

I'm writing a word vba which require to connect the mysql database.
I'm new to database thing, any1 have any idea ??

I'm thinking to the ADODB.Connection
But, I have no idea about the connectingstring, provider and driver,etc
I'm using "Mysql server 5.0" I've install in my computer, so I can do the
testing on my comp (localhost), and need to connect to the server on the
network later.

Many thanks
 
V

vbaNOOB

Thanks for the website.

However, I'm able to connect the mysql server. I'm too green for that. lol
These are my code:

Dim objDB, oRs
Set objDB = CreateObject("ADODB.Connection")

objDB.Open "Provider=MySQL ODBC3.51 Driver;" & _
"Data Source=localhost;" & _
"User Id=root;" & _
"Password=pwd"

when I run the code, it say "data source not found and no driver specified"

Am I doing sth wrong??
 
P

Perry

Try to replace
objDB.Open "Provider=MySQL ODBC3.51 Driver;" & _
"Data Source=localhost;" & _
"User Id=root;" & _
"Password=pwd"

by
objDB.Open "Provider=MySQLProv;" & _
"Data Source=localhost;" & _
"User Id=root;" & _
"Password=pwd"

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top