Not really helping you with the problem Ajoy, but just a general
observation.

That is, "one point of entry and one point of exit"....(I hate RETURNs
half way up through the code).

You would be better of doing :-

llFailed = .F.                  && Should be "ll" - as var is logical!
Try
        Open Database mydata Exclusive
        Set Database To mydata
        Pack Database
Catch
        llFailed = .T.
        Messagebox("Other users logged in")
Endtry

Return Not llFailed

Robbo.


Rob Anderson | Software Engineer | Pegasus, an Infor company |  t: +44
1536 495000 | d: +44 1536 495006 | f: +44 1536 495214 |
[EMAIL PROTECTED]  | www.pegasus.co.uk 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ajoy Khaund
Sent: 23 October 2007 07:55
To: Profox
Subject: TRY CATCH

In the INIT of a form I need to check if the dbc can be opened
exclusively. 
If Yes proceed else a message to try later as other users are logged in.
I am not sure of this TRY CATCH snippet.

Try
    Open Database mydata Exclusive
    Set Database To mydata
Catch
    lcFlag = .T.
    =Messagebox("Other users are currently logged
in.",64,c_messagetitle)
Endtry
If lcFlag = .T.
    Return .F.
Else
    Pack Database
Endif

Can anyone just help me. Something similar in Vfp6 was not a problem. A 
direct rebuild with Vfp8/9 did not work well. I wonder why.

TIA

Ajoy Khaund
Neamati Road
Near Bhogdoi Bridge
Jorhat 785 001
Assam, India

Tel: 91-376-2351288
Cell: 91-94350-92287
Mail: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]

"Walking on water and developing software from a specification are easy
if
both are frozen."
- Edward  V. Berard, "Life-Cycle Approaches" 



[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to