Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Bug when using list search with DBISAM

edited December 2001 in General
The problem
===========
I get an error when using a "in List" search condition in a report with
a DBISAM database if the Windows DecimalSeparator is set to a comma.


Detailed explanation
====================
When setting a search condition using a in list condition in the
designer dataview, ReportBuilder generates an SQL IN section without
spaces around the commas. For example:
SELECT * FROM Customers WHERE CustID IN (1,2,3);

The DBISAM database accepts that perfectly well *unless* the windows
DecimalSeparator is a comma. It that case it requires spaces around the
commas like:
SELECT * FROM Customers WHERE CustID IN (1 , 2 , 3);


Request
=======
Always add spaces around the comma when building the IN SQL section.

I already asked DBISAM to change their logic to also accept comma's
without spaces, but it would be nice if ReportBuilder would add them
always to be more robust. Especially because it would not hurt any other
database.


Proposed fix
============
This is the fix which will take care of this issue

daSQL.pas line 5821:
// JDMOD 17 Dec 2001 add spaces around comma otherwise DBISAM chokes on the
// IN statement if windows decimal separator is set to comma
// if (liIndex < lValues.Count - 1) then
// lsValue := lsValue + ',';
if (liIndex < lValues.Count - 1) then
lsValue := lsValue + ' , ';
// END JDMOD


Thanks
======
Just wanted to let your guys know, that ReportBuilder really is a
fabulous piece of software. Keep up the good work.

Jan Derk

Comments

This discussion has been closed.