Solved

how can I use the procedure of SQL Server?

Posted on 2002-03-15
8
187 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
loading dll from external path 1 211
Correct Component for Shopping Cart. 2 96
Convert a string into a TDateTime 5 50
Multiple image collision 13 69
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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