Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for indexing? #16

Open
btraas opened this issue Dec 14, 2015 · 10 comments
Open

Support for indexing? #16

btraas opened this issue Dec 14, 2015 · 10 comments

Comments

@btraas
Copy link

btraas commented Dec 14, 2015

Is there currently any support for indexing (CDX files)? Writing to tables works fine, other than it doesn't update its corresponding .cdx file, which is used by our legacy application.

Are there any plans to support this soon?

@luads
Copy link
Owner

luads commented Dec 14, 2015

I'm don't know how the CDX files work, so I don't plan to implement it soon. If you want to help implementing that, I would appreciate that. I could try to help after a first release, but currently I don't have enough time to start that.

@btraas
Copy link
Author

btraas commented Dec 16, 2015

No problem. I'll let you know if I figure it out

@jchimene
Copy link

I don't think think the author has thought through index creation. My current attempt will be to link https://github.com/jakubkulhan/btree to this structure. Using a btree object of {key:XXXXX, recno:NN} should do the trick. I'd like to wrap this in a handler class to automatically open the data and an array of index files. My first cut will be to support only one index file.

@gadget00
Copy link

how did this went?? @jchimene where you able to go through any of this??

I'm having the situation where the index files don't get updated when I write a new record or update one in the DBF and when I open the legacy foxpro app the new records are not shown, until I 'reindex' the DBF

@btraas
Copy link
Author

btraas commented Mar 31, 2018

+1 @gadget00, we're doing the same. Would be great to do in this library (or even an external command line program). Let me know if you find anything

@gadget00
Copy link

gadget00 commented Feb 9, 2020

@btraas so far I haven’t found a solution for this. How can we make a “reindex” function for this?? I just saw that there is a “pack()” function that saves the changes and re-counts the rows like the original VFP. There must be a way to trigger the reindex as well

@btraas
Copy link
Author

btraas commented Feb 9, 2020

@gadget00 poking through the code I didn't see any support for indexing, creating CDX files etc.

We ended up buying the Indexman command-line utility ($30) to reindex DBFs, which uses Microsoft's FoxPro DLLs to reindex. It's windows-only but I bet it works fine with wine.

https://dbfdoctor.com/en/news/IndexMan/

@gadget00
Copy link

@btraas can you give me an example of how to use that utility? I downloaded and installed it, and also read the help options but can't figure out how I'm supposed to use it. Thanks again

@btraas
Copy link
Author

btraas commented Feb 21, 2020

@gadget00 I use it like this:

C:\Program Files (x86)\IndexMan\IndexMan.exe <dbfFile> <cdxFile> [-nodeleted]

And wrapped in a C# service that can be triggered by our web server.

@DierteK
Copy link

DierteK commented Dec 22, 2020

@gadget00 I use it like this:

C:\Program Files (x86)\IndexMan\IndexMan.exe <dbfFile> <cdxFile> [-nodeleted]

And wrapped in a C# service that can be triggered by our web server.

I have tried it here also with IndexMan with the parameters -reindex -nodeleted.
If during the execution of IndexMan the FoxPro application runs also, no more entries are displayed within the application. It looks like an empty database.

Only after a new start of the FoxPro appication all rows (also the new ones) are shown :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants