By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,301 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,301 IT Pros & Developers. It's quick & easy.

Executing Stored procedure In Classic ASP

P: 50
I am trying to execute the code below. When I execute the exact same code in the Query Analyzer, I get 6 records so there are records to be found. But when I try to do it through ASP, I get Error Number 3704:

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:
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
Aug 13 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.