views:

1446

answers:

1

I've tried the below script but I am getting an error:

dim cn, rs

set cn = CreateObject("ADODB.Connection")
set rs = CreateObject("ADODB.Recordset")
cn.connectionstring = "Provider=MysqlProv; Data Source=Adonis; User Id=mysqluser; Password = mysqlpass;"
cn.open
rs.open "select * from Countries", cn, 3
rs.MoveFirst
while not rs.eof
    wscript.echo rs(0)
    rs.next
wend
cn.close
wscript.echo "End of program"

Its giving the following error:

C:\mysql.vbs(6, 1) ADODB.Connection: Provider cannot be found. It may not be pro
perly installed.

When I googled for an odbc connector I came up to this page where I could download the odbc 5.1 connector. Wondering if this is enough to connect to a mysql server 5.0 database...?

+2  A: 

Install MySQL Connector/ODBC 5.1 and use a connection string like the following

connectionString = "Driver={MySQL ODBC 5.1 Driver};Server=yourServerAddress;Database=yourDataBase;User=yourUsername; Password=yourPassword;"

Anton Hansson
no this does not work...I have installed the 5.1 connector correctly.
deostroll
What is the error message?
Anton Hansson
the same thing...
deostroll
It worked. I'm sorry...my bad. Instead of "Driver" I typed "Provider".
deostroll