本文介绍了使用纯 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 server 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 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!