Page 2 of 3

Re: FOXCDX and integer

Posted: Fri May 29, 2015 2:38 am
by messaoudlazhar
Hi,

Your index file is faulty (poorly tagged it), you must completely rebuild (erase and indexing new) is a defect in dtabaseEngine CDXDBF (reindexing or creating file without deletion does not correct this problem) so you have crush before reconstituting it.

After reconstitution it'll work the way you want.

Messaoud Mohamed Lazhar

Re: FOXCDX and integer

Posted: Fri May 29, 2015 4:14 am
by skiman
Hi Pedro,

Thanks for your test, but this isn't the problem. When you create the index with Xbase++, it will work.

However, I have to read the existing index from another application which is created with Visual Foxpro. In the DBF the fieldtype is an INTEGER with a lenght of 4. In Xbase this is converted to a Numeric and a search isn't working. I can create a new index, but this isn't updated when the other application adds something to the database. I want to check that database every 5 seconds to update my tables. I can't create a new indexfile every 5 seconds.

Re: FOXCDX and integer

Posted: Fri May 29, 2015 4:17 am
by skiman
Hi Messouad,

Thanks for your answer. I will ask if they have an option to recreate the indexfile from nil in that application.

Re: FOXCDX and integer

Posted: Fri May 29, 2015 5:43 am
by rdonnay
Can you send the database to me?

I would like to experiment with it.

Re: FOXCDX and integer

Posted: Fri May 29, 2015 5:49 am
by skiman
Hi Roger,

See the second post in this thread. I added the code I used for testing in xdbu and the DBF and CDX.

Re: FOXCDX and integer

Posted: Fri May 29, 2015 5:52 am
by skiman
Hi Messouad,

I asked to do a reindexing via the application. The result remains the same. I don't know if that application is creating a new indexfile or just executes a reindex.

Re: FOXCDX and integer

Posted: Fri May 29, 2015 6:14 am
by rdonnay
Chris -

I think I may have found something that works.

dbSeek( <number>, .t. ) always puts me on the correct record.
dbSeek( <number>, .f. ) always puts me at EOF.

BTW - I think there is something wrong with the index. I also tried opening the file with ADSDBE. It is supposed to be very FoxPro friendly, yet it errors on a dbSkip() when using the ARTCODE index.

Roger

Re: FOXCDX and integer

Posted: Fri May 29, 2015 7:10 am
by messaoudlazhar
Hi,

if you only make re-indexing the file, the problem persists. You must recreate it again (erase the file and indexing)

_________________
Best regards,

Messaoud Mohamed Lazhar

Re: FOXCDX and integer

Posted: Mon Jun 01, 2015 1:16 am
by skiman
Hi,

Since I can't trust the index created by the other application, I create one myself. If I get an EOF() after a seek, it means that there is new data added. At that moment I recreate the index.

Re: FOXCDX and integer

Posted: Mon Jun 01, 2015 4:43 am
by rdonnay
Chris -

Did you try my recommendation? - dbSeek( <n>, .t. )