Re: ADODataset: Query parameter used twice in the SQL satatement
From: Michael Jacobs (iq193_at_earthlink.net)
Date: 08/08/04
- Previous message: Dennis: "Re: Re: Re: TBetterADOdataset 4.04"
- In reply to: Jim Albertson: "ADODataset: Query parameter used twice in the SQL satatement"
- Next in thread: Jim Albertson: "Re: ADODataset: Query parameter used twice in the SQL satatement"
- Reply: Jim Albertson: "Re: ADODataset: Query parameter used twice in the SQL satatement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 8 Aug 2004 17:42:45 -0400
Hi Jim,
You don't specify how you are setting the value of the parameter, so I am
assuming you are using the 'ParamByName' method. What is happening is when
the SQL statement is examined to set the parameter a match is found on the
1st occurrence of 'MY_TIME_IN' and that conditions ends the search for a
matching parameter. The problem you are encountering is that you have 2
parameters in your statement even though you assigned the same name to them
they are separate and distinct objects within the SQL statement.
I hope this explanation helps.
Regards,
Michael
"Jim Albertson" <jimalbertson@yahoo.co.uk> wrote in message
news:4115d61a@newsgroups.borland.com...
> ..will result in inconsistent results.
>
> eg. SELECT * FROM PUNCHCARD WHERE ( PUNCHCARD.TIME_IN > :MY_TIME_IN ) OR
( PUNCHCARD.TIME_OUT > :MY_TIME_IN )
>
> Query criteria will not apply for the second time MY_TIME_IN is used !!
but if the SQL statement
> is changed to:
>
> SELECT * FROM PUNCHCARD WHERE ( PUNCHCARD.TIME_IN > :MY_TIME_IN ) OR (
PUNCHCARD.TIME_OUT > :MY_TIME_IN2 )
>
> Results are as expected.
>
> Is this by design or a bug? Gives me the creeps..
>
> JA
>
>
- Previous message: Dennis: "Re: Re: Re: TBetterADOdataset 4.04"
- In reply to: Jim Albertson: "ADODataset: Query parameter used twice in the SQL satatement"
- Next in thread: Jim Albertson: "Re: ADODataset: Query parameter used twice in the SQL satatement"
- Reply: Jim Albertson: "Re: ADODataset: Query parameter used twice in the SQL satatement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|