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()
> PACK
> ENDIF
> USE MyAlias
> ON ERROR
>#ELSE
> TRY
> USE MyAlias EXCLUSIVE
> PACK
> USE MyAlias
> CATCH
> ENDTRY
>#ENDIF
>
>
>Fabio