Board index » delphi » BDE problem with date and time rows (SQL Server 6.5)

BDE problem with date and time rows (SQL Server 6.5)

If I perform a select with a TQuery like the following:

q.SQL.Add('select * from table where date_column >= :date_value and date_time >=
:date_time')
q.ParamByName('date_value').AsDate:=date_value;
q.ParamByName('date_time').AsTime:=date_time;
q.Open

then I get an 'operation not supported' exception *if and only if* the
date value is greater than the greatest date value in the rows. If the
date value is less than or equal to the greatest date value in the rows
then I do not get this error. (I know SQL Server supports combined
dates and times - but not all databases do).

I'm using Delphi 4 C/S Upd#3. Any ideas ?

 

Re:BDE problem with date and time rows (SQL Server 6.5)


[replying to myself here!]

I've found the problem: UniDirectional was set to TRUE on the TQuery. This
puzzles me somewhat, as why is BDE moving backwards in the cursor?
Also, the problem doesn't occur at all if ODBC is used instead of BDE.

Quote
Michael J. Leaver wrote in message ...
>If I perform a select with a TQuery like the following:

>q.SQL.Add('select * from table where date_column >= :date_value and date_time
>=
>:date_time')
>q.ParamByName('date_value').AsDate:=date_value;
>q.ParamByName('date_time').AsTime:=date_time;
>q.Open

>then I get an 'operation not supported' exception *if and only if* the
>date value is greater than the greatest date value in the rows. If the
>date value is less than or equal to the greatest date value in the rows
>then I do not get this error. (I know SQL Server supports combined
>dates and times - but not all databases do).

>I'm using Delphi 4 C/S Upd#3. Any ideas ?

Other Threads