Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check for Exclusivity
Message
From
17/10/2001 09:38:48
 
 
To
16/10/2001 22:18:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00569279
Message ID:
00569525
Views:
28
>
>Since this issue comes up all the time, it certainly calls for a language mod.
>


I disagree. If you are using the Stonefield Database Toolkit, and you should be if you are using VFP, then this and many other things are handled for you.

For instance, from the SDT help.
******

Syntax:
oMeta.oSDTMgr.OpenTable(expC1 [, expC2 [, expL1 ;
[, expC3 [, expL2 [, expN]]]]])

Return: .T. if the table was opened as desired.
Parameters: expC1
The name of the table or view to open (if the table is a free table, specify the complete path if the table isn't in the current directory or the VFP path).
expC2
The order to set for the table:

Value Result
not specified the primary order for the table is used (if there is no primary order for the table, no order is used)
"PRIMARY" the primary order for the table is used (if there is no primary order for the table, no order is set)
blank no order is used
not blank the specified order is used
.NULL. don't create defined indexes for views


expL1
.T. if the table should be opened exclusively.

expC3
The alias to use for the table (optional: if it isn't specified, no alias is specified when the table is opened).

expL2
.T. to get the data for a view (ie. not to use the NODATA clause or requery the view if it's already open).

expN
The datasession to open the table in (optional: the default datasession 1 is used if it isn't passed).
*******


>It seems to me that the straight-forward change would be to add a NOERROR keyword to the USE command. Thus:
>
>select 0
>use MyTable exclusive noerror
>if upper(alias()) <> "MYTABLE"
> wait window "Cannot open exclusive"
>endif
>
>You might also want to include a TIMEOUT N option.
>
>Peter Robinson
Previous
Reply
Map
View

Click here to load this message in the networking platform