Board index » delphi » Confirmed BDE/IDAPI Bug!! No fix in sight!!

Confirmed BDE/IDAPI Bug!! No fix in sight!!

Greetings,

I have discovered a rather fundamental flaw in the
BDE/IDAPI that is a confirmed bug by Borland folks.
However, they can give me no time frame for a fix.
Maybe Borland will create BDEDEMO2.ZIP as "example"
BDE code with the fixed libraries!!!

These queries will fail in Paradox or a Delphi
TQuery component!!  The database engine returns
an error compaining about a missing ')'.  This
error even occurs in the second case where there
is no parens in the whole statement!!
Try it!!

select * from MyTable where
(MyTable.MyField > 1 and MyTable.MyField < 4)
or MyTable.MyField = 5

This fails too!!

select * from MyTable where
MyTable.MyField > 1 and MyTable.MyField < 4
or MyTable.MyField = 5

All of the following work!!

select * from MyTable where
MyTable.MyField > 1 and MyTable.MyField < 4
and MyTable.MyField = 5

select * from MyTable where
MyTable.MyField > 1 or MyTable.MyField < 4
or MyTable.MyField = 5

select * from MyTable where
(MyTable.MyField > 1 or MyTable.MyField < 4)
and MyTable.MyField = 5

It was suggested to me to use ODBC drivers to
access the Paradox tables.  A huge kludge, and
I couldn't find drivers for Pdox 5.0 tables.

Any word on fixes from Borland types???

Don Huff
dh...@sky.net

 

Re:Confirmed BDE/IDAPI Bug!! No fix in sight!!


Quote
>I have discovered a rather fundamental flaw in the
>BDE/IDAPI that is a confirmed bug by Borland folks.
>These queries will fail in Paradox or a Delphi
>TQuery component!!  The database engine returns
>an error compaining about a missing ')'.  This
>error even occurs in the second case where there
>is no parens in the whole statement!!

The bug that you describe has been in Idapi/BDE since its creation.  If you
write the query in PDW using QBE, then run it, you get the right answers.  Push
the SQL button in PDW and the correct SQL code is returned.  However, running
this code, either in PDW or in Delphi gives the error that you describe.

Despite the poor immplementation of SQL in the BDE, it is often possible to work
around this problem.

eg:

Quote
>select * from MyTable where
>(MyTable.MyField > 1 and MyTable.MyField < 4)
>or MyTable.MyField = 5

could be replaced by (or simething similar using "between")

Select * from MyTable where
MyTable.MyField between 2 and 5 and MyTable.MyField <> 4

Wade Auchterlonie

Other Threads