I employ the following code to test whether the table is being used exclusively somewhere and thus avoid a conflict when 2 tables need to be opened exclusively. The code has worked great for us in FP2.6 and I migrated it over to VFP 6.0. But now it is indicating that a table is exclusively used, when it is opened in another data session as shared. I have a form that opens a database and some of its tables for use by the form. When I try to open the form again (having 2 of the same form open) I get an error message that the table is exclusively opened somewhere else. The other form does not open it exclusively as I can see the table and the status bar indicates a shared open. This seems to happen when a talbe is opened in a datasession. I can run the code from the command line with a table opened as shared and it responds fine. Has anyone seen this error before from FOPEN in VFP?
parameters dlock_l1
dlock_fh=fopen(dlock_l1,0) && Network Exclusive Use
if dlock_fh <0 .and. (ferror()=5 .or. ferror()=31)
dlock_rz=3
ENDIF
Bret Hobbs
"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope