Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Sort Order Problem with DBISAM and ReportBuilder
Sat, May 1 2010 7:21 PMPermanent Link

Scott Rowat

Hi Tim,

I'm still struggling to get ReportBuilder working with DBISAM perfectly in terms of sort order comparison.  It works 90% of the time but there are some cases that still cause a problem.

You mentioned in the previous thread regarding this discussion that DBISAM uses the *Windows API* CompareStringA call on any non-ANSI Standard locales.  All my DBISAM tables have the Locale set to ANSI Standard.  When the Locale is set to ANSI Standard what comparison method (Windows API or other) does DBISAM use in determning the Sort Order?

If I can know exactly how DBISAM does the comparison then I will modify the ReportBuilder code to do the comparison in the same manner.

Thanks,
Scott


From previous thread
>>>>>
No, DBISAM uses the *Windows API* CompareStringA call on any non-ANSI
Standard locales, so you are gettting an ANSI comparison based upon the
Windows 1252 (ANSI) character set.   The difference is due to the
SORT_STRINGSORT flag being used, which affects how punctuation characters
such as '-' are sorted.
>>>>>
Mon, May 3 2010 1:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Scott,

<< You mentioned in the previous thread regarding this discussion that
DBISAM uses the *Windows API* CompareStringA call on any non-ANSI Standard
locales.  All my DBISAM tables have the Locale set to ANSI Standard.  When
the Locale is set to ANSI Standard what comparison method (Windows API or
other) does DBISAM use in determning the Sort Order? >>

DBISAM uses a straight-up binary (Byte() cast on ANSI character set)
comparison when the locale is set to ANSI Standard.  The comparison code is
in the dbisamlb.pas unit:

function CompareBytes(FirstBuffer: pAnsiChar; SecondBuffer: pAnsiChar;
                                   CompareLength: Word; Descending:
Boolean): Integer;

--
Tim Young
Elevate Software
www.elevatesoft.com
Image