English 中文(简体)
关闭 asp 对象
原标题:operation cannot be performed object is closed asp

正在执行. 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 页面上执行时会发生什么 。

问题回答

似乎您尚未打开记录板, 因为它是包含 rs 的线条。 open 会被评论 。

编辑 : 实际上, 更近一点看它似乎有特定的行在引用另一个查询。 但是, 在您使用它之前, 记录板仍然需要打开 。





相关问题
How to import excel file in web page useing Classic ASP?

We are trying to open an existing excel file (2003) from server location in a web page and save it again in the same location using following syntax. Set ExcelReportApp = CreateObject("Excel....

What s the best method to do paging in my ASP page

What s the best method to do paging in my ASP page when displaying a list of items? I knew that there is no equivalent to MySQL s LIMIT clause present in SQL Server, either 2000 or 2005. How can I ...

Using Classes in a Dictionary in Classic ASP

I usually do C# but have inherited a classic ASP project. I have defined a class: Class clsPayment Public Name End Class Set objPayment = New clsPayment objPayment.Name = "...

Response.Redirect HTTP status code

Why is it that ASP/ASP.NET Response.Redirect uses a HTTP-302 status code ("Moved Temporarily") even though in most cases a HTTP-301 status code ("Moved Permanently") would be more appropriate?

form inside form serialize problem

I am trying to submit a form inside another form because I will need first form s outcome in the second form. I tried using form serialize as advised in some other threads. Problem here is, I dont ...

热门标签