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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indexing problem

Status
Not open for further replies.

Damby

Programmer
Jan 29, 2002
13
0
0
CA
I am writing a program that is accessing Foxpro dbf files from VB6 and I have not been given the cdx files. Now I would like to recreate them, but I don't know how.

I don't have visual Foxpro.

I would like to know if there is an utility I could use to do that and if there is something special to know about reindexing. Right now, I am using dbAssist 2000 to do the job, but I always get an empty cdx file(0 octets) when I reindex it.

If I could also be directed to a good source of information about cdx indexes on the net, I would appreciate.

Thanks
 
Do you know what the index keys are comprised of? Since .CDX's are quite proprietary, you would need Fox or something built with Fox in order to recreate them. A standalone index file may be able to be created with a third party tool though.

Dave S.
 
To add to Dave's comments, since the Index tag expression information is stored in the CDX, unless you know what it is, you won't be able to recreate then index (even with FoxPro). Why do you need the indexes? I don't believe ODBC makes good use of them anyway. If it's complaining that the table "requires" them, then you could just edit the .DBF header to indicate there are no indexes. The Structural Index flag is in the 29th byte - 0 -> no CDX file, 1 -> open CDX file.

Rick
 
Thanks for your answers, this was very helpful.

Finally, as rgbean mentionned, I don't need indexes. But as he guessed right, the ODBC driver was complaining it needed one.

I dont' know how, but it stopped asking for it suddenly and completely!!!???

As to edit the .DBF header, I would be glad to be able to do so, but I don't know. Some hints???

Thank you very much.
 
You'd need a hex editor. There are a number of freeware / shareware ones available for download at the usual places. (VFP even gives you one as a demo program - of course you need VFP to run it! <g>) I use WinHex ( it's a bit expensive for a one shot, but it's also one of the most complete File / Disk / Memory editors I've found, and the author / developer is very responsive.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top