Solved

how can I use the procedure of SQL Server?

Posted on 2002-03-15
8
189 Views
Last Modified: 2010-04-05
When I use Delphi to connect to SQL Server,how can I use
the store procedure?
0
Comment
Question by:lozit
8 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6870752
? what procedure
0
 
LVL 4

Expert Comment

by:nestorua
ID: 6870950
HI,
Yes, what procedure ?
Sincerely,
Nestorua.
0
 

Author Comment

by:lozit
ID: 6872796
store procedure
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Accepted Solution

by:
nestorua earned 50 total points
ID: 6873850
HI,
Put TDatabase object and TStoredProc components on the
Form or Datamodule, connect your TDatabase comp. with a database, connect TStordProc comp. with database
(choosing corresponding DataBaseName), then choose the Name of a Stored procedure you want to use.
Don't forget to define the parameters if they exist.
That's all.
Sincerely,
Nestorua.
0
 
LVL 15

Expert Comment

by:simonet
ID: 6875612

First of all, if you're using SQL Server, you should forget about BDE (and TDatabase, TQuery, TStoredproc, etc). USE ADO INSTEAD.

It's easier, simpler, faster and requires no additional files other then the executable if deployed to most Windows 98/NT4SP6/2000/ME/XP. If anything else is required, then MDAC is the only thing you need, and it's pretty simple to install.

Now back to the issue:
There are 2 ways to acess stored procedures in SQL Server.

One of them is to use the TADOStoredProc component. It links to a TADOConnection and all the parameters are set on it (ADO automatically retrieves the parameters for you).

The other way, much easier but not necessarily better,  is to use a TADOQuery component and create the query like this:

exec spMyProcedure param1, param2, paramN


then simple execute the tADOQuery.

Yours,

Alex
0
 

Author Comment

by:lozit
ID: 6875913
HI,
    thank you all very much.
My name is Y.Q Luo,Chinese.Can I
make friends with you?Please contact
me by email:lozit@263.net.


Yours,

lozit
0
 

Expert Comment

by:CleanupPing
ID: 9343261
lozit:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:knightmad
ID: 9470804
Wow, Its been a long time since this comment have been visited!

lozit,
No comment has been added lately (19 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: split points between nestorua http:#6873850 and simonet http:#6875612

-- Please DO NOT accept this comment as an answer ! --

Thanks,

knightmad
EE Cleanup Volunteer

Remember you (all) can object this recommendation if you disagree, just leave a post here explaining why are you objecting and what should be done instead.
Within 7 days probably this thread will be closed, so, hurry up! : )
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi: how to send PJL commands to printer 3 109
Communication Between RC4 Delphi <-> PHP 3 123
FMX enumerated colours 2 118
How to load 2 images in same column in Delphi 2 57
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question