Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recreating .NTX outside of Clipper 1

Status
Not open for further replies.

roelvdh

Technical User
Aug 27, 2010
4
0
0
NL
I have an old app probably based on Clipper (it creates *.dbf and *.ntx files). Sometimes the .ntx files seem to be corrupted and my app won't run.
I don't have Clipper so I cannot re-index the *dbf files. Is there any possibility to recreate the *.ntx files from the *.dbf's by using an external program, i.e. VB code?
Roel
 
Most apps would have a routine in them somewhere to 'Pack and Reindex' - usually in a utilities menu, or perhaps from a commend line.

Are all the files that need to be indexed in a single folder? If so, and assuming that there are no UDFs or similar in the index keys, it would not be difficult to create a simple routine to do a pack and reindex for you.

Martin

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thank you. It is a very simple general ledger program and it does not have a "Pack and Reindex"-option. Now that you mention "Pack", it seems that the problems with *NTX happen after packing. The app uses 5 *.DBF files, each having just one *.NTX, all in the same directory.
 
can you zip them and send them to me?


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Unfortunately I cannot post the most relevant files on this public forum. In the meantime I found a secret command in my app, which can do a few system tasks, re-indexing a.o.
Still, I would be interested in some generic VBA-code that would make an NTX-file from a given DBF. We would like to do some batch pre-processing outside of the app. We would be able to generate the correct DBF after pre-processing, but not the accompanying NTX and the app won't run without it.
I know B+Tree is complicated and I hesitate trying to write such a program myself. A few hints might help a lot.
Thank you for your kind help.
 
If you could send me the ntx files, I could help.
I would happily look at them and write an exe that would make new ones, foc.

Without a bit of data and the ntx files I cannot help.

Good luck

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
On refection, if you opened a COPY of each of the index files in Notepad - you could see the index key in the first 400 characters or so.

If you then posted that information here, with the name of the data table, and the name of the index file, I could easily write an index building file for you. Assuming there are no UDFs in the keys.

Like this:
ACCOUNT.DBF ACCOUNT1.NTX ACCOUNT_NO
INVOICE.DBF INVOICE1.NTX INVOICE_NO
...

You could then download that from my web site.




Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
One additional thought, the DBF file sizes may be an issue. What's the file sizes, and how many records does the largest file contain. When my routines recreate an existing NTX file, I erase the old index file first. If there is corruption in the header, just reindexing will only propogate the corruption.

Griff has you on the right track, DBU will allow you to define the index structure, and also allow you to recreate the indexes. As long as the data size or a corrupt file DBF or NTX, you should be OK.

Bu tif the Reindex Pack function diesn't make it better, you probably have another issue to deal with before you're done.

Jim C.
 
I'm really grateful for the fine support I get here. Right now I'm OK as someone in another forum hinted me to a hidden system command in my app that I didn't know of. This command will do a re-index and re-totalize.

Thanks also for the DBU-link. Not having Clipper myself I'm still in doubt whether I could have used it. I came here because I thought there would probably exist ample VBA-snippets for indexing a DBF. In my naivity I had probably underestimated this task. Thanks for the education!

Roel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top