BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TADOQuery and parameters

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Frédéric SCHENCKEL
Guest





PostPosted: Fri Sep 19, 2003 3:18 pm    Post subject: TADOQuery and parameters Reply with quote



Hello everybody,



In runtime, if a give a generic SQL phrase to a TADOQuery (Execute
procedure for example), how can I set the parameters directions ? (I'm
using MS SQL server 2000)

The SQL phrase can be really different : some cases I have no
parameters, others cases only input parameters and other cases input and
output parameters. Since the SQL phrase comes from another process the
program don't know the direction of the parameters.

Per default TADOQuery sets pdInput as direction. In case of an output
direction, SQL server reports an error.

How can I do this ?


Thanks


Frédéric

Back to top
Brian Hollister
Guest





PostPosted: Fri Sep 19, 2003 8:23 pm    Post subject: Re: TADOQuery and parameters Reply with quote



Check out the help file for TParameter.AddParameter and it gives a good
example even shows direction...



Back to top
Frédéric SCHENCKEL
Guest





PostPosted: Mon Sep 22, 2003 8:59 am    Post subject: Re: TADOQuery and parameters Reply with quote



Brian Bushay TeamB wrote:
Quote:
In runtime, if a give a generic SQL phrase to a TADOQuery (Execute
procedure for example), how can I set the parameters directions ? (I'm
using MS SQL server 2000)

Either use
Parameters.refresh

or
Parameters.clear
and then create new parameters
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]


Sorry, but my question wasn't precise enough ! At runtime I don't know
the direction of the parameters (It's a part of an multi-tiers server
and each call can be a different query with different parameters). The
problem is I know the parameters but not their directions. If the query
executes a stored procedure with output parameters I should set the
parameters with the right direction. But how can i guess the direction ?

I think I could get these informations asking the properties of the
stored procedure. But it's perhaps a bit complicated...

In this case I should rather use a TADOStoredProc component ?


Thanks

Frédéric



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.