Added 2 lines of code in MemData.pas..

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Japhar
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Added 2 lines of code in MemData.pas..

Post by Japhar » Wed 30 May 2007 07:21

Hi,

We have licenced version of SDAC components.

I have an issue in my project, to sloved it i have made changes in MemData.pas file of TMemData.CompareStrValues() procedure.

Modification:

//If the Value is blank then making it to 1 when Length(FieldValue) > 0
....
else
if (ValueLen = 0) then
ValueLen := 1;

if lxCaseInsensitive in Options then
Res := AnsiCompareTextS(Value, Copy(FieldValue, 1, ValueLen))

This is becuase, comparing blank value is not happing properly.
Res := AnsiCompareTextS(Value, Copy(FieldValue, 1, ValueLen))

Ex: Value=''; //blank
FieldValue='A'

Now AnsiCompareTextS('', Copy('A', 1, 0)) is returning 0 (ie. True).

I feel above statement should be AnsiCompareTextS('', Copy('A', 1, [b]1)). After chaning it is returning Flase value.

When we are comparing blank value with 'A' which should returns false. But it is returing True becuase of ValueLen is '0'.

So i have added if condition. Please confirm the change which i have made is OK??? or does it leads to any problems....

Problem in the project: I have a screen where it has 2 components
1. Index Flip Flop - Component written by us using TEdit class
It's just like a drop down box and it is data ware contol.

2. Grid

Index Flip Flop list all the values. If i select first value then grid will sort with the selected value. Now if i remove the value from the Index Flip Flop then sort should remains same. But it is not happing like this.
It is sorting with the first index value in the Flip Flop.

pl let me know if the above description is not very clear...

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Wed 30 May 2007 12:06

Thank you for information.
We have reproduced the problem and fixed it.
This fix will be included in the next build of SDAC.
Your fix is correct and you can use it as a temporary solution.

Post Reply