ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
I used the same connection string to execute other stored procedures with this user id without problem in this database. For some reason it is dying here.
The user id has execute rights on this procedure.
I’ve already spent half a day trying to get this snippet to work right. If I had any hair left, I would be pulling it out.
Any help would be appreciated.
Ramon
Here’s the code:
Expand|Select|Wrap|Line Numbers
- Dim Connection
- Dim ConnString
- Dim rs
- Dim SQL
- Dim b_Error
- ConnString = "Provider=sqloledb;Data Source=<demo>;" & _
- "Network Library=DBMSSOCN;Initial Catalog=<demo>;" & _
- "User ID=<demo>;Password=<demo>;"
- Set Connection = Server.CreateObject("ADODB.Connection")
- Set rs = Server.CreateObject("ADODB.Recordset")
- Connection.Open ConnString
- b_Error = False
- On Error Resume Next
- rs.Open "exec <demo>.dbo.txp_report_contract_set 2672,'N00104-02-G-0600-5036'",Connection
- response.write "1 b_Error=" & b_Error & "<br>" & Err.number & "<br>"
- If rs.EOF = True Then
- 'Just tests to see if rs.EOF = True causes an error which is captured below.
- End If
- If Err.number <> 0 then
- b_Error = True
- End If
- response.write "2 b_Error=" & b_Error & "<br>" & Err.number & "<br>"
- response.end