Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing a single database so the DBC can be zipped
Message
 
 
To
09/03/2005 21:41:51
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00994286
Message ID:
00994382
Views:
22
In addition to Sergey's solution, if you are using VFP8 or later, you can use TRY...CATCH to do this much easier:
TRY
   USE MyTable Exclusive
   * if it worked the code after this line will continue to execute.
CATCH
   * if you are here, the table could not be opened exclusively
FINALLY
   * cleanup code here
ENDTRY
>I'm writing a little utility to data drive the backup of folders by zipping them (mostly data folders of multiple VFP apps on a server)
>
>I have a table of the apps, their locations etc.. I have included fields for the name of a dbc and dbf that I know cannot be opened exclusively if anyone is in the app.
>
>My thought was to programmatically try to open the dbf exclusively and if that fails, delay trying to zip the data folder.
>
>The problem is that if I use exclu successfully and then close the table the DBC is still considered open by Winzip and there is an error when you zip it. (dbf zips fine) CLOSE DATABASES ALL is going to close the database my app is using.
>
>Is my solution found in using a different data session or is there a trick to tell the os to release any handle on the dbc?
>
>Seems I am missing something easy and obvious
>
>Am I ?
>
>TIA
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform