Parameters with same name in one query

From: Sascha Schroeder (sascha.schroeder_at_e-pro.de)
Date: 02/23/04


Date: Mon, 23 Feb 2004 14:18:51 +0100

Hello,
i have a query string which contains a sub query, like:

SELECT *
FROM TABLE1
WHERE FIELD1 = :Param1 AND
FIELD2 IN
(SELECT FIELD2
FROM TABLE2
WHERE FIELD3 = :Param1)

I add the query to my query object and replace the parameters:

Query.ParamByName('Param1').AsInteger := 1;

My MSSQL-Server returns no rows but an error. I only get the
message in german, so i don't post it here. The message says, that
a parameter wasn't correct definied.

Is there a trick in ADO to do that? When i use the BDE there is no
problem to do that.

Thanks for your answers,

Sascha



Relevant Pages