Hi
I want to import data from mysql (in the localhost) to the a Word table, how can I connect to mysql? I have got mysql in my machine, odbc driver as well.
Help me please
Claire
Printable View
Hi
I want to import data from mysql (in the localhost) to the a Word table, how can I connect to mysql? I have got mysql in my machine, odbc driver as well.
Help me please
Claire
Hi
Thanks for your reply.
I have had odbc driver in my machine. Here is my vb code for connection
Dim mConn As New MySQLconnection
mConn.ConnectionString = "Driver={MySQL ODBC 3.51Driver};Server=localhost;Database=mydb;Uid=myid;Pwd=myps;option=3"
mConn.Open
However I got error message, I am newer in this area, could you please correct my code? I know mConn is defined wrong, but how should I define it.
Thanks in advance
claire
From the second link I posted:
# ODBC 3.51 Local database:
"DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=myDatabase;USER=myUsername;PASSWORD=myPassword;OPTION=3;"
# ODBC 3.51 Remote database:
"DRIVER={MySQL ODBC 3.51 Driver};SERVER=data.domain.com;PORT=3306;DATABASE=myDatabase; USER=myUsername;PASSWORD=myPassword;OPTION=3;"
Hi Salvelinus
Thanks a lot for your reply. If I use code below (I only need to connect to local host for the time being)
"DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=myDatabase;USER=myUsername;PASSWORD=myPassword;OPTION=3;"
an error message: complile error: syntax error
I am applying this code in vb Editor in Word document, what I want to do is to connect mysql from the vb Editor using vb code, then I could try to get the data from mysql and put into table in the Word.
Please could you give me more detailed instruction? Many thanks in advance
Claire
Well, you'd have to substitute your db's name, password, etc, along with making sure your ODBC driver is 3.51, etc. We take data from Access & put it on MySql for the web, so don't know as much about pulling it into Word. Post some code.
Hi
Thanks. I have substituted my db's name, password, etc, and also I have odbc 3.51 installed, as I am using it with asp.net application. I used Access database with Word before, it works fine, just not familar with mysql. Anyway, thanks a lot