Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2004, 01:17 PM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Set Rs = Cm.Execute

I have a SP.
When I run it I get dataset , no errors.
Now I call this Sp from ASP

Set Rs = Cm.Execute
response.write "Rs(0)=" & Rs.Fields(0).Value

But when run the code I get this error:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.

Looks like Rs was not populated.
How do I test if Rs was pumped with records?

 
Old April 7th, 2004, 01:22 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If Not (Rs.BOF And Rs.EOF) Then
   'Records returned
Else
   'No records returned
End If

Peter
-------------------------
Work smarter, not harder
 
Old April 7th, 2004, 01:25 PM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's exactly what I have:
If Not (Rs.BOF And Rs.EOF) Then

And the error occurs at this line - If Not (Rs.BOF And Rs.EOF) Then

 
Old April 7th, 2004, 01:27 PM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually the exact error is:
ADODB.Recordset error '800a0e78'

Operation is not allowed when the object is closed.



 
Old April 7th, 2004, 04:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It looks like the recordset is closed, and not necessarily empty. Even on a "full" but closed recordset, you cannot use these kind of methods and properties.

How does the sproc look like? Are you sure it's returning any records and are you sure it performs a valid SELECT statement? Are you suppressing the "Records Affected" message?

To try that out, try this:

MySecondRecordSet = Rs.NextRecordSet()

If Not MySecondRecordSet.EOF Then
Response.Write("Not EOF")
End If

If this code runs fine, you'll need to suppress the messages that SQL Server generates using SET NOCOUNT ON

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath: set operation with a disjoint node set rich_unger XSLT 7 May 6th, 2008 09:24 AM
In Cursor set and execute statement related proble param99 SQL Server 2000 0 December 15th, 2006 02:55 AM
connection.execute and command.execute difference vinod_yadav1919 Classic ASP Databases 0 September 28th, 2005 06:34 AM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM
RS Manager and RS Server on 2 different computers Choose File BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 July 22nd, 2004 10:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.