使用纯vbscript连接到mysql 5.0数据库吗? [英] Connect to mysql 5.0 database using pure vbscript?
本文介绍了使用纯vbscript连接到mysql 5.0数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试了以下脚本,但出现错误:
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"
出现以下错误:
C:\mysql.vbs(6, 1) ADODB.Connection: Provider cannot be found. It may not be pro
perly installed.
当我搜索odbc连接器时,我想到了此页面,我可以在其中下载odbc 5.1连接器.想知道这是否足以连接到mysql服务器5.0数据库...?
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...?
推荐答案
安装 MySQL Connector/ODBC ,并使用连接字符串,如下所示
Install MySQL Connector/ODBC and use a connection string like the following
connectionString = "Driver={MySQL ODBC 5.1 Driver};Server=yourServerAddress;" & _
"Database=yourDataBase;User=yourUsername;" & _
"Password=yourPassword;"
这篇关于使用纯vbscript连接到mysql 5.0数据库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文