Solved

how can I use the procedure of SQL Server?

Posted on 2002-03-15
8
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month7 days, 9 hours left to enroll

632 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