Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to Test for Exclusivity
Message
 
To
07/02/2004 17:38:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00875208
Message ID:
00875255
Views:
18
Hi Fabio.. thanks for your reply.

I can see that this works fine but will I have a problem with the select settings:

I normally would have the Alias set up in DE along with order, filters etc.
If I do a USE MYALIAS , will I not lose these settings ?

e.g. In MY DE or elsewhere I have settings such as:
Sele 0
Use Myalias
Set Order to MyOrder
Set Filter to Myfilter etc


When I now want to pack the file, and I Use Myalias, will I not get a File In use and afterwards I will have lost my Order and Filter settings.

(I read somewhere ..cant remember where about doing this sort of thing in a separate data session so that it would not interfere with other settings such as Filters and Orders... maybe this would be the way to go)

Thanks for your help.

Regards,
Gerard








>
>I would like to do the following:
>If IsThisFileUsedExclusive(MyAlias) = .T.
>Do Nothing
>Else
>Select MyAlias
>Set Exclu On
>Pack
>Set Exclu Off
>Endif
>
>Is there any command in VFP8 which does a IsThisFileUsedExclusive ?
>
>Regards,
>
>Gerard
>

>
>this is like the external lock problem.
>
>The only correct solution is:
>try to get exclusive
>
>
>
>SELECT 0
>#IF VERSION(5)<800
>   ON ERROR *
>   USE MyAlias EXCLUSIVE
>   IF USED() && AND ISEXCLUSIVE()
>     PACK
>   ENDIF
>   USE MyAlias  && RELEASE exclusive
>   ON ERROR && restore error handling
>#ELSE
>   TRY
>     USE MyAlias EXCLUSIVE
>     PACK
>     USE MyAlias  && RELEASE exclusive
>   CATCH
>   ENDTRY
>#ENDIF
>
>
>Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform