我有一个与访问数据库(.mdb)连接的vbs。在我的Windows XP工作完美,但在我的Windows 7 x64我有驱动程序的问题......
这是我的代码:
Set MyConn = CreateObject("ADODB.Connection")
Set MyConn = CreateObject("ADODB.Connection")
MdbFilePath = "c:\mis documentos\fusion\fusion.mdb"
'The error point to the next line
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
'querys'
SQL_versionlocal = "SELECT versionlocal.version FROM versionlocal;"
SQL_version = "SELECT version.version FROM version;"
Set RSL = MyConn.Execute(SQL_versionlocal)
' Wscript.echo "Versión local " & RSL("version")
versionlocal = RSL("version")
这就是问题所在:
[Microsoft] [ODBC Driver Manager] Can not find the data source name and no default driver specified.
任何提示或帮助将不胜感激,如果您需要更多信息,请告诉我,我将编辑该帖子。
答案 0 :(得分:2)
您的Microsoft-Office是32位还是64位? 您可以尝试使用在C:\ Windows \ Syswow64 \ Wscript.exe中找到的32位wscript \ cscript运行脚本