Page 1 of 1

Queries with parameters, an example please

Posted: Sat 11 Feb 2006 22:53
by rogermon
Hello,

I'm getting started with your package. Static queries seem to work fine, but I'm having no luck with using parameters in queries. Can anyone provide an example using parameters for input and output variables?

I can "build" query strings, but it would be nicer if I can avoid that.

Thanks in advance,

Roger

Posted: Mon 13 Feb 2006 12:32
by Ikar
Try using something like:

Code: Select all

        MSQuery.SQL.Text := 'SELECT * FROM emp WHERE empno = :empno'
        MSQuery1.Params.ParamValues['empno'] := 7839;
        MyQuery.Execute;
By the way, using parameters in SDAC is the same as in ADO, BDE. Please, refer to the Delphi Help for detailed information.