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
Stored Procedure with multi resultset
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
- 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
-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
-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
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
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