Stored Procedure with multi resultset

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Joey

Stored Procedure with multi resultset

Post by Joey » Thu 13 Oct 2005 09:03

I use a stored procedure which has 2 resultset (same as the sp_helplogins). I tried the Open, OpenNext methods, and it's didn't work.
Can anybody tell me that what's wrong or I take a mistake, and if that's the problem how can I fix it?

Regards,
Joey

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 14 Oct 2005 07:50

We have tried sp_helplogins and could not find any problem. Please specify

- Exact version of Delphi or C++ Builder
- Exact version of SDAC. You can see it in About sheet of TMSConnection Editor
- Exact version of Microsoft SQL Server and OLE DB provider that you use. You can see it in Info sheet of TMSConnection Editor

Joey

Post by Joey » Tue 18 Oct 2005 23:21

-Delphi 7.0 (Build 8.1)
-3.50.0.11
-Microsoft SQL Server: 08.00.2039
Microsoft OLE DB Provider for SQL Server: 08.00.1117

I tried it again and it worked. Once. And the second time it was return only one resultset. After the 4th, 5th time I got the error message: "procedure CreateAndFillParamAccs already called (c:\...\sdac\OLEDBAccess.pas, line 3344)." The changes: I began to use the OLEDBAccess.pas (include the uses list).

the code:
MSConnection1.Open;
MSQuery1.ParamByName('Data').Value := StrToDate('...');
while MSQuery1.OpenNext do // the second time generate an error
begin
ShowMessage(MSQuery1.Fields[0].AsString);
end
MSQuery1.Close;
MSConnection1.Close;

MSQuery1.SQL.Text = 'exec SumDataForDate :Date'

in the Query Analyzer it's works fine. When I tried it first works fine. After that put OLEDBAccess to the uses list it's went wrong. Since that I can take anything it's wrong. At the moment, does that run once and return one resultset, and all fine. But if I run the second time it's do an error and nothing too.

It's work so different and I don't understand what it's wrong. What I do wrong.

Regards,
Joey

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 19 Oct 2005 06:25

Try to download SDAC last version (3.55.1.19). If problem persists then send us (sdac*crlab*com) complete small sample to demonstrate it

Joey

Post by Joey » Wed 19 Oct 2005 13:13

Hi,

I tried it, it's works fine...

Till I change the FetchAll property to False. While it's True the Query carry all of the result sets, but if it's false, the Query carry only the first result set.

This is the normal function and if it, how can I manipulate the returned rows for the result sets? Some times it can contain many-many row which is uninterested for me.

Best regards,
Joey

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 20 Oct 2005 13:29

This is MS SQL server protocol-specific behavior. We can't change it.

Joey

Post by Joey » Thu 03 Nov 2005 22:15

Thank's for all...

Best regards,
Joey

Post Reply