Solved

how can I use the procedure of SQL Server?

Posted on 2002-03-15
8
188 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now