views:

96

answers:

1

Is it safe to update DBF files using Advantage Local Server .Net provider whilst a FoxPro application is running that may also be accessing the DBF files? i.e. does Advantage take care of row locking?

+5  A: 

Advantage can be used for concurrent access between a .NET application and a VFP application using our compatibility locking. When in compatibility locking mode Advantage accesses the tables using the same mechanism as VFP. Therefore row locking will be handled by Advantage.

The Advantage .NET data provider also contains an additional object called AdsExtendedDataReader which provides more ISAM functionality. You can use an AdsExtendedDataReader to explicitly lock records. You can get more information here.

Chris Franz
Chris is correct. In addition, when in compatibility locking mode Advantage uses the same index locking offsets as FoxPro as well, so ALL concurrent access is safe, not just table access.
Jeremy Mullin
Just to clarify, when updating or inserting using an AdsCommand and SQL statements, Advantage will handle the locking. However, it is possible to explicity control the locking using the methods on AdsExtendedDataReader.
ChrisR
Yes the SQL statement will take care of all locking automatically. With AdsExtendedDataReader you will be able to lock records explicitly.
LanceSc