Solved

how can I use the procedure of SQL Server?

Posted on 2002-03-15
8
185 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

21 Experts available now in Live!

Get 1:1 Help Now