[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Stored procedures in MS SQL 7.0

Can one get from Delphi all results of the stored procedure in MS SQL 7.0, which returns multiple recordset?
0
kolod
Asked:
kolod
1 Solution
 
RBertoraCommented:
Listening..
0
 
simonetCommented:
Just use a TStoredProc and link it to a TDataSource.

in the TStoredProc, you must set at least these properties:

Databasename, StoredProcName and Params (this one can be set in Runtime )

Then simply set the Active property to true.

Yours,

Alex
0
 
AndyDCommented:
TStoredProc won't work for multiple record sets. The way to do it is to drop a TQuery on to your form, point it at the database in question the set the SQL text of the Query to :-

Select * From MyStoredProc;

You can then point a datasource and data-aware controls to it.

Regards,


Andy
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
kolodAuthor Commented:
Hi Andy

I tried to do as you said, but I've got a message:
" Table not Exist "MyStroredProc" "
(of course there stayed the name of my stored proc)

Thanks
0
 
karooCommented:
concur with Andy,
Query is the best way to do this.

Kolod:
The only way i can reproduce "Table does not exist..." is if my SP name is wrong.
See if you can do this: use WISQL or database explorer, connect to your DB and run the SP from there (SELECT * FROM "mystoredproc")
0
 
karouriCommented:
Listening..
0
 
guntherdsCommented:
multiple recordsets can't be returned in one recordset, I think it's possible by using ADO, but I'm not sure
0
 
AndyDCommented:
Have you missed any parameters when you called your SP?
0
 
yk030299Commented:
how about create the stored procedure by sa?
because dbo.spname & someuser.spname will have difference result in M$-SQL
0
 
TAZICommented:
Hi..

Well, I had a problem with Delphi and SQL 7.0.  There is a problem in regard to the TStored Procedure Component.  I get the results via a TQuery Component. I put the Stored Procedure Name in the TStrings of the TQuery Component e.g)

sp_GetResults :0,:1

sp_GetResults is the name of the Stored Procedure and it has 2 parameters that need to be passed to it in order to get the results.  Then in the Params property, select whether your parameters are is Input, Result, Output etc.

To Run the proc..do the ffg. Assume the TQuery Component is called Query1.
Query1.Close;
Query1.params[0].asString := Value To Input (Parameter 1)
Query1.params[1].asString := Value To Input (Parameter 2)
Query1.Open;

This works 100 % . . . I use it all the time.

Also...there are 2 files that need to be updated.
<sqlmss32.dll>
<dbx.dbi>

This <dbx.dbi> file is in the ffg directory \\ProgramFiles\Borland\Delphi4.0\Bin

The <sqlmss32.dll> file is in
\\CommonFiles\BDE

The updated files can be downloaded from
ftp://www.synetics.co.za/pub/.

If it is unavailable please let me know what you email address is and I can email them to you.

Hope you understand what I am saying

Regards
Tazi



0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now