Re: TZF - Network Program ... try/finally

Philip Kidder <[email protected]>
Newsgroups gmane.comp.lang.delphi.topaz
Message-ID <[email protected]>
Bob,

In order to Pack a database it must be opened exclusive. Your finanally code just opens the database on the one computer exclusive. The second computer still has the file open so your finally code should fail to open that database since it wants exclusive use of the database. You need to get the second computer out of the program then you can Pack. 

I've had this problem for years a one clients. All I can do is ask everyone to get out of any programs that use the database for a few minutes while I Pack or Reindex.

Phil
  ----- Original Message ----- 
  From: [email protected] 
  To: [email protected] 
  Sent: Tuesday, June 10, 2003 9:24 PM
  Subject: TZF - Network Program ... try/finally




  In developing a network program, I am trying to use
  a  "try/finally"  structure to allow the physical deletion
  of records (PACK).  I am getting a File Sharing error
  ( Error # 32 ) when I try to pack and there are two users
  in the system.  My Try/Finally looks like this:


      try   // this will create an exception if another user is using the system
        DM.DBF_Courts.Active:=False;
        DM.DBF_Courts.Exclusive:=True;
        DM.DBF_Courts.Active:=True;
        DM.DBF_Courts.Pack;
      finally   // but I thought this would "clear" the exception
        DM.DBF_Courts.Active:=False;
        DM.DBF_Courts.Exclusive:=False;
        DM.DBF_Courts.Open;
      end;


  Thanks,
  Bob Watson
  Atlanta, GA

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
==^================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.