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

Different betwen IDX and CDX

Status
Not open for further replies.

warik

Programmer
Jun 28, 2002
169
ID
I already have old foxpro program for DOS and I would like to make new program for Windows with VFP.

But I still want to use the old table. So, can I do that, because that are differen for index extention.

What I have in my mind, I make new vfp program, but I also can run the old foxpro program in the same table.

Thank you
 
HI Warik,

When you say Old FoxPro, FPD2.6 also had CDX index. Infact it is very very long time that I stoped using IDX files.

Even if you have earlier version, CDX indexes of FPD2.6 differ from VFPs CDX files. The point is the approach.


If this is so essential, I would still use the CDX and also create the IDX so that, the day you feel.. no more IDX.. CDX will be in place.

And you should be aware of how to make the tables accessible by both FPD and VFP. Or else, you could end up VFP stopping the access to FP2.6.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Warik,
Fox Software introduced the .CDX file format for compound indexes with FoxPro 2.0. I believe, as does Ramani above, that the .CDX files have changed since those earlier days, so I would be very careful with this. Ramani is also correct to offer the caution regarding touching the "old" Foxpro tables with a new VFP application. It is very easy to break an old application by opening the tables with the newest versions of VFP. As always, be sure to make complete backups of all tables and all related files before you start experimenting.

My experience is that is is more trouble than it is worth to try to retain an old tables accessibility under old program versions while sharing with new apps than to just update the old app using the new tools. Otherwise I would suggest accessing through ODBC tools (I'm assuming this is possible, I do not have ODBC experience) or managing the integration of the old and new apps via exports and imports via delimited file(s).

Just my suggestion, hope this helps.

 
I'm not exactly sure what you mean by the extension for the indexes is different in FPD as opposed to VFP. Here are my comments for what they are worth...you can use both of the apps on the tables...just leave them as FREE TABLES and don't try and incorporate any of the tables into a VFP Database Container. If you do then VFP will make some additions to the table headers which will render them unuseable for the FPD application. If you need them in a database container for your VFP Application then create VIEWS in your database that are just a copy of the FREE TABLES. There is a good argument for leaving all of your tables free and making views for them...makes the application more portable and you can change the database backend to almost any database you please without having to rewrite any of your application's code (well not very much of it anyways). Slighthaze = NULL
 
warik,
One point I don't think has been addresed in the previous responses, is one very important difference between IDX and CDX files. FoxPro (and VFP) will automatically open .CDX files with the table, so there shouldn't normally be anyway to Add/Edt/Delete records without the index file reflecting the changes. On the other hand, it's the program / programmer's responsibility to open IDX files. If they aren't open when changes are made to the table, the index(s) won't be updated and the next time they are opened you may not be able see "see" all the records when using them!

Rick
 
Btw guys, I ever heard about if we use VFP, we won't have to always reindex our table as we use FP. Is that right?
 
VFP is not prone to destroying indexes on irregular shutdowns the way FPD is, however you should still have a reindexing routine that can be run periodically that will delete the tags and recreate them to keep the indexes as sleek and small as possible...if you just reindex without deleteing the tags the index files will grow and grow. Slighthaze = NULL
 
Slighthaze,

if you just reindex without deleteing the tags the index files will grow and grow.

How to do reindex for deleting tags as you said?

=====

How do you think the best way to reindex data?
Usually I use this for the first time index:


use mytable
index on number tag number


for the next time reindex is :


use mytable
reindex


Well, what do you think if I not use reindex for the next time index. I mean, I always use index on number tag number. Will it make the reindex methode become slower?

Is that different between second methode aboutmentioned with :


use mytable index on number



Thank's
 
If you are using IDX's with your tables and are recreating them at runtime each time they are needed then you need not worry about reindexing...however, if you are using CDX files which are automatically opened with the tables then you may want to delete all the tags from the CDX and recreate them to keep the size of the CDX down...i would go through all of it with you, but it looks to me like you are recreating your indexes at runtime so there is no need Slighthaze = NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top