Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Returning RecordSet to ASP is empty

Reply
Thread Tools

Returning RecordSet to ASP is empty

 
 
Eli Sidwell
Guest
Posts: n/a
 
      02-10-2004
Trying to return a Recordset to an ASP and the Recordset is empty.
The StorredProc works in the query analyzer and it even works from a
quick VB app that I wrote to test it.

The storedproc that I am using is fairly complex (creates some
temporary tables and populates them with 'Insert Into Select ...', but
the during testing the only Select statements that return visible rows
is the final one that returns the finished table with an 'Order By
....'.

I am trying to figure out if I am receiving multiple recordsets or if
I am out of environment space. Do the 'Insert Into Select ..'
statements return empty or null recordsets ?

Thanks

Sid ..
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-10-2004
Eli Sidwell wrote:
> Trying to return a Recordset to an ASP and the Recordset is empty.
> The StorredProc works in the query analyzer and it even works from a
> quick VB app that I wrote to test it.
>
> The storedproc that I am using is fairly complex (creates some
> temporary tables and populates them with 'Insert Into Select ...', but
> the during testing the only Select statements that return visible rows
> is the final one that returns the finished table with an 'Order By
> ...'.
>
> I am trying to figure out if I am receiving multiple recordsets or if
> I am out of environment space. Do the 'Insert Into Select ..'
> statements return empty or null recordsets ?
>

Yes. The informational messages (x rows were affected ...) you see in QA are
returned as extra resultsets. You should make a practice of including the
line "SET NOCOUNT ON" at the beginning of all your procedures to suppress
these messages.

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
 
Al Reid
Guest
Posts: n/a
 
      02-10-2004
If you are using SQL Server, put a SET NOCOUNT ON at the beginning of the SP to stop SQL Server from returning empty recordsets for
each non row-returning DML statement. If you cannot do that, user NextRecordset to move to the next one until you get to the one
that is not empty.

--
Al Reid

"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so." --- Mark Twain

"Eli Sidwell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) om...
> Trying to return a Recordset to an ASP and the Recordset is empty.
> The StorredProc works in the query analyzer and it even works from a
> quick VB app that I wrote to test it.
>
> The storedproc that I am using is fairly complex (creates some
> temporary tables and populates them with 'Insert Into Select ...', but
> the during testing the only Select statements that return visible rows
> is the final one that returns the finished table with an 'Order By
> ...'.
>
> I am trying to figure out if I am receiving multiple recordsets or if
> I am out of environment space. Do the 'Insert Into Select ..'
> statements return empty or null recordsets ?
>
> Thanks
>
> Sid ..



 
Reply With Quote
 
Eli Sidwell
Guest
Posts: n/a
 
      02-10-2004
It worked, Thanks for the follow up.

Sid ..

"Al Reid" <(E-Mail Removed)> wrote in message news:<emr6Br#(E-Mail Removed)>...
> If you are using SQL Server, put a SET NOCOUNT ON at the beginning of the SP to stop SQL Server from returning empty recordsets for
> each non row-returning DML statement. If you cannot do that, user NextRecordset to move to the next one until you get to the one
> that is not empty.
>
> --
> Al Reid
>
> "It ain't what you don't know that gets you into trouble. It's what you know
> for sure that just ain't so." --- Mark Twain
>
> "Eli Sidwell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) om...
> > Trying to return a Recordset to an ASP and the Recordset is empty.
> > The StorredProc works in the query analyzer and it even works from a
> > quick VB app that I wrote to test it.
> >
> > The storedproc that I am using is fairly complex (creates some
> > temporary tables and populates them with 'Insert Into Select ...', but
> > the during testing the only Select statements that return visible rows
> > is the final one that returns the finished table with an 'Order By
> > ...'.
> >
> > I am trying to figure out if I am receiving multiple recordsets or if
> > I am out of environment space. Do the 'Insert Into Select ..'
> > statements return empty or null recordsets ?
> >
> > Thanks
> >
> > Sid ..

 
Reply With Quote
 
Eli Sidwell
Guest
Posts: n/a
 
      02-11-2004
In addition, the Stored Proc returns some values like recordCounts and
other stuff and this is done by a second select statement, but there
appears to be no other recordsets. i.e.

* sp_GetStuff****
Select * from tblSuff Where ...
Select @Count, @OtherSuff

*********

+ ASP +++
RcdSet.Open "Stored_Proc ..."
Do Until RcdSet.EOF
response.write RcdSet(1)
Loop

Set RcdSet = RcdSet.NextRecordSet()
iCount = RcdSet(0)
Response.write iCount

+++++++++

I keep Getting a 'Syntax Error' or 'object required'. How do I get
values returned by the second Select if the are not in a table format
?

Thanks

Sid ..




http://www.velocityreviews.com/forums/(E-Mail Removed) (Eli Sidwell) wrote in message news:<(E-Mail Removed) om>...
> It worked, Thanks for the follow up.
>
> Sid ..
>
> "Al Reid" <(E-Mail Removed)> wrote in message news:<emr6Br#(E-Mail Removed)>...
> > If you are using SQL Server, put a SET NOCOUNT ON at the beginning of the SP to stop SQL Server from returning empty recordsets for
> > each non row-returning DML statement. If you cannot do that, user NextRecordset to move to the next one until you get to the one
> > that is not empty.
> >
> > --
> > Al Reid
> >
> > "It ain't what you don't know that gets you into trouble. It's what you know
> > for sure that just ain't so." --- Mark Twain
> >
> > "Eli Sidwell" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) om...
> > > Trying to return a Recordset to an ASP and the Recordset is empty.
> > > The StorredProc works in the query analyzer and it even works from a
> > > quick VB app that I wrote to test it.
> > >
> > > The storedproc that I am using is fairly complex (creates some
> > > temporary tables and populates them with 'Insert Into Select ...', but
> > > the during testing the only Select statements that return visible rows
> > > is the final one that returns the finished table with an 'Order By
> > > ...'.
> > >
> > > I am trying to figure out if I am receiving multiple recordsets or if
> > > I am out of environment space. Do the 'Insert Into Select ..'
> > > statements return empty or null recordsets ?
> > >
> > > Thanks
> > >
> > > Sid ..

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in Returning Recordset in ASP vinodkus@gmail.com ASP General 1 04-14-2007 06:01 PM
Problem in Returning Recordset in ASP vinodkus@gmail.com ASP General 1 04-12-2007 11:54 AM
binding empty recordset to datagrid RufusGoofus ASP .Net Web Controls 0 01-22-2005 12:53 AM
Recordset Empty Error J P Singh ASP General 4 01-16-2004 02:43 PM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM



Advertisments