Board index » delphi » Is there a way? 2nd Posting

Is there a way? 2nd Posting

Hi All,
I am writing an application with Delphi5 and MS SQL 7 and ADO.
I am using a stored proc to calculate some user permissions.
The permissions are stored in multiple tables and require more than one
select statement to come up with the required result set.

My problem is that the ADOStoredProc control that I am using returns the
result set from the first select statement it encounters in the stored
procedure.

How can I get the result set from the last select statement executed?

Please help,
Thanks, John

 

Re:Is there a way? 2nd Posting


When you have processed the first Record Set move to the next one by

        ADODataSet1.RecordSet := ADODataSet1.NextRecordSet(NoRecords);

(NoRecords is an output parameter)

Regards
Dave Sharples

Quote
-----Original Message-----
From: John Shearing [mailto:johnshear...@masquesound.com]

Posted At: 15 November 2000 07:15
Posted To: sqlservers
Conversation: Is there a way? 2nd Posting
Subject: Is there a way? 2nd Posting

Hi All,
I am writing an application with Delphi5 and MS SQL 7 and ADO.
I am using a stored proc to calculate some user permissions.
The permissions are stored in multiple tables and require more than one
select statement to come up with the required result set.

My problem is that the ADOStoredProc control that I am using returns the
result set from the first select statement it encounters in the stored
procedure.

How can I get the result set from the last select statement executed?

Please help,
Thanks, John

Re:Is there a way? 2nd Posting


John,

Create additional component for example ADODataSet1 and use
ADOStoredProc.NextRecordset
as follows:

ADODataSet1.RecordSet := ADOStoredProc.NextRecordset

then analize data in ADODataset1
if you have more then 2 recordset in result set call NextRecordset again and
again and analize data.

Andy O.Verezhak
http://www.intersys.com.ua

Quote
John Shearing wrote in message <8utee1$p...@bornews.inprise.com>...
>Hi All,
>I am writing an application with Delphi5 and MS SQL 7 and ADO.
>I am using a stored proc to calculate some user permissions.
>The permissions are stored in multiple tables and require more than one
>select statement to come up with the required result set.

>My problem is that the ADOStoredProc control that I am using returns the
>result set from the first select statement it encounters in the stored
>procedure.

>How can I get the result set from the last select statement executed?

>Please help,
>Thanks, John

Re:Is there a way? 2nd Posting


Hi Dave,
Thanks for the help
John

Re:Is there a way? 2nd Posting


Hi Andy,
Thanks for helping me.
John

Other Threads