 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Frédéric SCHENCKEL Guest
|
Posted: Fri Sep 19, 2003 3:18 pm Post subject: TADOQuery and parameters |
|
|
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
|
Posted: Fri Sep 19, 2003 8:23 pm Post subject: Re: TADOQuery and parameters |
|
|
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
|
Posted: Mon Sep 22, 2003 8:59 am Post subject: Re: TADOQuery and parameters |
|
|
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 |
|
 |
|
|
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
|
|