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 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 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用纯 vbscript 连接到 mysql 5.0 数据库?


基础教程推荐
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01