Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 How to detect a table in use by views
Message
From
05/10/2004 04:36:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00948339
Message ID:
00948725
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
>Hi
>
>>That's why you need an error trapping procedure. That's basically the only way to find, if the table could be opened excusively or not.
>
>I just gave your code a try but it seems that the class/form takes the error responsibility so the following line raises an error in the CodeBook framework rather than the error number being assigned to lnErr=ERROR()
>
> USE (m.tcTable) AGAIN &tcMode IN 0 ALIAS (m.tcAlias)
>
>Please advise, how can I let your function handle the error rather than passing it up he heirarchy?


Bhavbhuti,
I checked the code and it already have bugs in itself (sorry Nadya). ie:

if !used(m.tcAlias) ...

Is never a guarantee that table is not in use (Nadya remember alias might not be the same as tablename). Plus table might be in use with or w/o same alias name in another session. Code not looping sessions if I didn't miss it.

use (m.tcTable) again &tcMode in 0 alias (m.tcAlias)

Having tcMode as EXCLUSIVE doesn't guarantee you opened it in exclusive mode. It might be opened as shared and no error shows up (bug,feature?). ie:
use employee shared
use employee again exclusive in 0 alias e1
? Isexclusive('employee'), IsExclusive('e1')
"AGAIN" there is introducing an implicit logical error that you can't catch w/o checking.

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