Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Know if a table or database is in use
Message
From
20/06/2003 07:01:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
20/06/2003 06:54:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00802124
Message ID:
00802129
Views:
27
>Hi.
>I have a table that could be updated by
>more than one diferent application in
>diferents client computers. Question:
>Is there a way to know if an application
>is using a table or database before
>you open it in another application?

There are basically 2 ways :
1) Using error
local llInUSe
on error llInUSe = .t.
use Table1 exclusive
on error
if llInUse
*...
2) Try to open lowlevel readwrite
local llInUse
lnHandle = fopen('table1.dbf',12)
llInUse = ( lnHandle < 0 and ferror() = 5 )
if lnHandle > 0
 fclose(lnHandle)
 use Table1 exclusive
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform