0

谁能告诉我如何通过 vb 脚本连接 infobright 数据库。我写了一个代码,但它显示一个错误:

provider can not be found.

我写的代码是:

Option Explicit
Dim conn, sqlstr 

sqlstr = "SELECT COLLATION_NAME FROM COLLATIONS"


'Database connection info
set Conn = CreateObject("ADODB.connection")
Conn.ConnectionTimeout = 30
Conn.CommandTimeout = 30
conn.open("Provider=Microsoft.Jet.OLEDB.4.0;Database=information_Schema;Username=root;Password=''")

dim  showList

Set showList = conn.execute(sqlstr)

while not showList.eof

            Wscript.echo "Collation Name:" & showList("COLLATION_NAME")

showList.MoveNext
WEND

conn.close
4

1 回答 1

0

安装 MySQL Connector/ODBC 5.1 并使用如下连接字符串

connString = "驱动程序={MySQL ODBC 5.1 驱动程序};服务器=服务器地址;数据库=数据库;用户=用户名;密码=密码;"

于 2013-06-07T12:59:28.033 回答