我有下面的代码,它给我一个错误“当对象关闭时不允许操作”。我在这里缺少什么?
Dim dbconnect, dbresults
Set dbconnect = CreateObject("ADODB.Connection")
Set dbresult = CreateObject("ADODB.Recordset")
dbconnectString = "driver=iSeries Access ODBC Driver;System=***;UID=***;PWD=***;Naming=1"
dbconnect.Open (dbconnectString)
mySQLQuerry ="Select XOORIG from FIQDLIB.FSFPXO as400xo WHERE as400xo.xoefdt = 1130418 and as400xo.xotrsq in (75440)"
dbresult.Open mySQLQuerry, dbconnect
答案 0 :(得分:0)
打开连接后,使用WScript.Echo dbconnect.State
检查connection state。您的连接字符串也会关闭。根据{{3}},驱动程序名称应该用大括号括起来。