Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Index problem after converting DBF+CDX to ADT

4 posts in FoxPro Last posting was on 2008-09-29 16:52:54.0Z
ACE User Posted on 2008-09-25 08:02:09.0Z
From: "ACE User" <spambox@heartprofit.nl>
Subject: Index problem after converting DBF+CDX to ADT
Newsgroups: Advantage.FoxPro
Date: Thu, 25 Sep 2008 09:02:09 +0100
X-Priority: 3
X-Library: Indy 9.00.12
X-Newsreader: <dedXmlGateway>
NNTP-Posting-Host: 213.26.58.195
Message-ID: <48db3a08@solutions.advantagedatabase.com>
X-Trace: 25 Sep 2008 01:13:12 -0700, 213.26.58.195
Lines: 25
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!213.26.58.195
Xref: solutions.advantagedatabase.com Advantage.FoxPro:262
Article PK: 1109617

Hi,

I've converted several DBF files to ADT format including the indexes.
However it is trange to see that something happened to the index
ordering.

I have a record in the DBF with only the character ~ (tilde) in the
first field of the index.
VFP makes this record the BOTTOM record (the DBF has codepage 850 set
BTW).
However, when i convert to ADT table, maintain the same index expression
and all, this record becomes the TOP when viewing the table ordered by
index.

What's happening, can anybody help me?

Conversion is done with the Client Engine, with AdsConvertTable() and
AdsCreateIndex90().

Thanks,
Robert Hekkers



--- posted by geoForum on http://delphi.newswhat.com


Peter Funk (ADS) Posted on 2008-09-25 15:49:50.0Z
Date: Thu, 25 Sep 2008 15:49:50 +0000 (UTC)
Message-ID: <864d0bcb156ba8caed0b2fede5c1@devzone.advantagedatabase.com>
From: Peter Funk (ADS) <pfunk@nospam.com>
Subject: Re: Index problem after converting DBF+CDX to ADT
Newsgroups: Advantage.FoxPro
References: <48db3a08@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Pro 1098.1
NNTP-Posting-Host: 10.24.38.185
X-Trace: 25 Sep 2008 09:43:35 -0700, 10.24.38.185
Lines: 17
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.185
Xref: solutions.advantagedatabase.com Advantage.FoxPro:263
Article PK: 1109618

Hello Robert,
What is the index expression exactly? Probably what you are seeing is how
Advantage handles NULL field values in ADT tables. If your index expression
has the + operator in it (eg "firstname+lastname"), then the entire key will
be NULL if either of the fields is NULL. If instead your expression used
the data typeless join operator ; (eg "firstname;lastname"), you'll probably
get the results you expect. You can read more about expression engine operators
here: http://devzone.advantagedatabase.com/dz/webhelp/Advantage9.0/expeng/expression_engine_operators.htm

If that is not the case, please post your index expression and the field
types involved in the expression.

Regards,
Peter Funk
Advantage R&D


ACE User Posted on 2008-09-29 13:17:24.0Z
From: "ACE User" <spambox@heartprofit.nl>
Subject: Re: Index problem after converting DBF+CDX to ADT
Newsgroups: Advantage.FoxPro
References: <48db3a08@solutions.advantagedatabase.com> <864d0bcb156ba8caed0b2fede5c1@devzone.advantagedatabase.com>
Date: Mon, 29 Sep 2008 14:17:24 +0100
X-Priority: 3
X-Library: Indy 9.00.12
X-Newsreader: <dedXmlGateway>
NNTP-Posting-Host: 213.26.58.195
Message-ID: <48e0c9e6@solutions.advantagedatabase.com>
X-Trace: 29 Sep 2008 06:28:22 -0700, 213.26.58.195
Lines: 27
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!213.26.58.195
Xref: solutions.advantagedatabase.com Advantage.FoxPro:267
Article PK: 1109621

Hello Peter,

Thanks for your reply, i hope you can help me!
The index expression is like FIELD1+FIELD2 where both field values
are '~'.
So i have no NULL values in any field in the index expression.

I was more thinking in the direction of collation; i have tried ansi,
oem etc. in the connection properties but also with no succes.

Next thing i did was create a new table manually, with the Advantage
Data Architect.
It contains 2 character fields, named C1 and C2, both length 10.
Created an index named A1, index expression C1;C2.

And again, after adding a few records and setting index to A1 makes the
record with the '~' in C1 go all the way to the top...
Now i'm lost...

Regards,
Robert Hekkers
Heart Informatisering B.V.
The Netherlands



--- posted by geoForum on http://delphi.newswhat.com


Peter Funk (ADS) Posted on 2008-09-29 16:52:54.0Z
Date: Mon, 29 Sep 2008 16:52:54 +0000 (UTC)
Message-ID: <864d0bcb157678caf038a905e1fd@devzone.advantagedatabase.com>
From: Peter Funk (ADS) <pfunk@nospam.com>
Subject: Re: Index problem after converting DBF+CDX to ADT
Newsgroups: Advantage.FoxPro
References: <48e0c9e6@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Pro 1098.1
NNTP-Posting-Host: 10.24.38.185
X-Trace: 29 Sep 2008 10:46:38 -0700, 10.24.38.185
Lines: 27
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.185
Xref: solutions.advantagedatabase.com Advantage.FoxPro:268
Article PK: 1109622

Hello Robert,
I assume you're using the DUTCH language with Advantage, if not please let
me know.

I was able to re-create the behavior with a simple ADT table and the Dutch
ANSI collation. Looking at the OEM Dutch collation I can see that the ~
character comes after the normal alphabet characters. Looking at the ANSI
Dutch collation, it comes before. So it looks to me like a difference between
the two ANSI and OEM character sets (note: ADT tables always use the ANSI
character set & collations). My conclusion is that Advantage is behaving
correctly with the collation information that it is given.

What you can do to change this behavior is create your own collation for
Advantage to use. In the server's installation directory there is a utility
called ANSICHR.EXE which you can use to create your own collation. Just
start it up, browse to your ansi.chr file, open it, then click the Create
button and it will create a new collation based on the PC's current language.
Once you have your new collation in the ansi.chr file, you can then stamp
that collation into the ADS.EXE binary using the AdsStamp.exe utility. Once
you have the new language in the ADS.EXE binary, start ADS, reindex your
table and you should see the data ordered the way your PC normally would.

Regards,
Peter Funk
Advantage R&D