Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best coding practices regarding open/unopen tables
Message
De
21/12/2003 11:51:48
 
 
À
21/12/2003 10:24:06
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00859873
Message ID:
00861107
Vues:
20
> Remember that views opens the tables and dbcs, but the update of records
> is an SQL UPDATE type command. So the table is USEd AGAIN, and that alias,
> whatever it is, is closed after the update. I believe this USE AGAIN does
> help in preventing corruption.

I think it is not quite so easy. ;-) First, SQL UPDATE will not close the table, and the current record pointer in the table will be moved if it is used already - regardless of the alias - meaning that the table is most definitely not USEd AGAIN internally.

If I understand our resident wizards (David, Sergey et al) correctly then SQL commands will affect the underlying tables - that is, they will go 'directly to the DBF' - and they will ignore any SET FILTER, buffered changes and other things that may have been inflicted on the work area of an opened table. Of course, the moving of the record pointer will cause row-buffered changes to be flushed to the DBF if Fox picks the workarea containing the changes for executing the UPDATE.

A partial workaround is to use a similar strategy as the one I posted for SQL SELECT - use the table to be updated under a specific alias and specify that alias as the target of the SQL UPDATE.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform