正在执行. vbs 文件, 并在其中调用存储程序 。
function getJobHistory(byval ServerName)
****************************
* Connecting to server
dim rsArray
msgbox(ServerName)
cn.open "Provider=SQLOLEDB.1;Data Source=" & ServerName & ";Integrated Security=SSPI"
cmd.activeconnection =cn
MsgBox(cn.State)
If Err.Number <> 0 Then
Call HandleErrors(Err.Number, Err.Description, "Error Connecting To Server " & ServerName & "")
end if
cmd.commandtext = "SELECT * FROM SYS.SYSDATABASES"
query1="SELECT * FROM SYS.SYSDATABASES"
sql = "exec UMRDB..sp_Getobsoletebackupfile 0,0,0, , , , ,0, , , ,0"
mobjwritelog.Write(query)
query=query & " insert into UMRDB..FileInfo select * from #fileinfo"
query=query & " drop table #disk drop table #file"
cmd.commandtext = query
rs.Open query,cn
set rs=cn.Execute(sql)
MsgBox(rs.RecordCount)
do while not rs.BOF and not rs.EOF
rsArray=rs.GetRows()
nr=UBound(rsArray,2)
MsgBox(nr)
rs.MoveNext
loop
rs.Close
end if
end function
***********************
它让我误差如下:
Error: Operation is not allowed when the object is closed.
Code: 800A0E78
Source: ADODB.Recordset
在查询分析器中执行同一存储的 procedulte 。 它需要 17 秒来执行程序。 当我在. vbs 脚本. 或 asp 页面上执行时会发生什么 。