Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 5, cursor indexes
Message
De
20/08/1999 15:52:52
 
 
À
19/08/1999 23:54:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00254283
Message ID:
00256044
Vues:
27
>PMFJI: I think you found the real solution, Laurisa. Seems to me the file contention in the original message was due to using the hard coded CDX filename on the server for all users. Each user would have distinct cursor filenames, but try to use the same CDX filename (which of course is trying to be exclusive use) -- a recipe for disaster in a multi-user environment... Indexing by tag name only on the updateable cursor automatically handles that problem as each user gets a unique cursor filename and cdx filename.
>
>Actually, IMHO, indexing on any table should ALWAYS just reference the tag name and NOT an index filename to be used -- else you will probably have the CDX get saved (and not automatically erased) even though the cursor 'dbf' (*.TMP) automatically erases itself when closed. Also, specifying a filename for a CDX that does not exactly match the dbf filename will make it NOT be a 'production' index (ie: associated with the table), and therefore will not automatically open when its (non-cursor) table is opened -- especially if you use memvars with paths/drives in them for these filenames, and the CDX ends up on a different drive or directory than where the references table is located. Worse, if the DBF still thinks it has a 'production' CDX in another location but that location is not available at time of opening the table (ie: different drive mapping on network, etc.), it will cause an error. So, not only is the code easier to read and understand without specifying CDX filenames, it is
>'safer' for letting FP/VFP manage its own files automatically.
>
>HTH
>
>Rob

Just to finish this off, I totally agree, now that I understand how it works - it makes perfect sense. It was a "badly learned" habit on my part from when I first started programming using the examples and hadn't really thought about until now. It's amazing how sometimes something that's really simple can bite you in the butt when it's not learned properly the first time around. But that's a whole 'nother conversation. I guess that's what makes the UT all worthwhile. Thanks!!

Laurisa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform