Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Richard Conlan
  Where is Richard Conlan?
 
 New York - United States
 Richard Conlan
 To: Craig Moore
  Where is Craig Moore?
 
 United Kingdom
 Craig Moore
 Tags
Subject: RE: Why is it so hard to back up the database!?
Thread ID: 32959 Message ID: 33743 # Views: 4 # Ratings: 0
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Tuesday, December 02, 2003 7:03:55 PM         
   


The database is on my local machine, and the folder is not shared, and I am the only one working with this project, so it is pretty definite that no other PC has it open. I am running Windows 2000 SP4, and am not running Backup, etc. So...here is the thing...sometimes when I open VFP and immediatly run the app everything works fine...and sometimes it doesn't...and the only difference seems to be whether the database files are getting successfully released. The exe does not open the database and then zip it - as demonstrated in the below code the database is closed and then immediatly zipped.

*frustrated*

RMC

> Is the database on the network or the local machine, is there defiantly no way another pc can have it open, not even the standard NT backup, can you try ensuring that you do not have a vfp session open and that your exe does not open the database and then zip it, that way you will know that it is your own session that is not releasing it, if it is then I would try placing an inkey() command in just after the close database all command just to slow it down a bit, but I can only imagine this would happen on a slow/faulty network.
>
>
> > As far as I can tell the problem has nothing to do with Xceedzip...this is why I hate including code in posts....because people get to into addressing the code instead of the problem I am describing. Xceedzip, PKZip, Winzip -- all have the same problem. The problem is that they claim the file is in use...which implies that FoxPro is not correctly releasing it.
> >
> > RMC
> >
> > > > So, given the following...
> > > >
> > > >
> > > > * Close all open tables.
> > > > CLOSE DATABASES ALL
> > > >
> > > > * Build default file name.
> > > > strDefaultFilename = "Archive " + LTRIM( STR( YEAR( DATE() ) ) ) + LTRIM( STR( MONTH( DATE() ) ) ) + LTRIM( STR( DAY( DATE() ) ) )
> > > >
> > > > * Prompt the user for the archive file.
> > > > strPath = PUTFILE( "Archive:", strDefaultFilename, "ZIP" )
> > > >
> > > > * Make sure the user selected a file.
> > > > IF !EMPTY( strPath )
> > > >
> > > > * Fetch a reference to the main form.
> > > > frmMain = m->gobjGlobalData.GetMainForm()
> > > > strApplicationPath = m->gobjGlobalData.GetApplicationPath()
> > > >
> > > > WITH frmMain.XceedZip.
> > > > * Zip the current database files.
> > > > .ZipFilename = strPath
> > > > .AddFilesToProcess( strApplicationPath + "*.dbf" )
> > > > .AddFilesToProcess( strApplicationPath + "*.cdx" )
> > > > .AddFilesToProcess( strApplicationPath + "*.fpt" )
> > > > .AddFilesToProcess( strApplicationPath + "*.dcx" )
> > > > .AddFilesToProcess( strApplicationPath + "*.dbc" )
> > > > .AddFilesToProcess( strApplicationPath + "*.dct" )
> > > > intZipResult = Zip()
> > > > ENDWITH
> > > >
> > > > IF intZipResult = 0
> > > > MESSAGEBOX( "Archive created successfully.", MB_ICONINFORMATION )
> > > > ELSE
> > > > MESSAGEBOX( frmMain.XceedZip.GetErrorDescription(0, intZipResult), MB_ICONEXCLAMATION )
> > > > ENDIF
> > > > ENDIF
> > > >
> > > >
> > > > Sometimes the *.dcx, *.dbc, and *.dct get zipped up fine.
> > > > Sometimes it gets errors because they are in use.
> > > >
> > > > Thoughts?
> > > >
> > > > =(
> > > >
> > > > RMC
> > >
> > > Beats me. I don't use xceed zip. winzip works just fine for me so I can't give you a clue on this.
> > > Did you try another wildcard in the .AddFilesToProcess() function, like in:
> > > .AddFilesToProcess(*.d??)
> > >
> > > I guess that would theninclude the DBC, DCX, DCT and DBF files in one command.
> > >
> > > Boudewijn LutgeĀ®ink
> > > Boudewijn.Lutgerink@foxite.com
> > > The music, played at a wedding, reminds me every time to music played when soldiers march to the frontier... (Heinrich Heine)


ENTIRE THREAD

Archive Database Posted by Richard Conlan @ 11/18/2003 9:00:53 PM
RE: Archive Database Posted by Geoff Franklin @ 11/19/2003 1:05:52 PM
RE: Archive Database Posted by Richard Conlan @ 11/19/2003 3:10:36 PM
Archive Database -- Which files do I need? Posted by Richard Conlan @ 11/19/2003 10:31:13 PM
RE: Archive Database -- Which files do I need? Posted by Boudewijn Lutgerink @ 11/20/2003 7:21:33 AM
RE: Archive Database -- Which files do I need? Posted by Richard Conlan @ 11/20/2003 3:01:57 PM
RE: Archive Database -- Which files do I need? Posted by Richard Conlan @ 11/20/2003 3:56:33 PM
RE: Archive Database -- Which files do I need? Posted by Boudewijn Lutgerink @ 12/12/2003 9:21:42 AM
How do I back up the database? Posted by Richard Conlan @ 11/21/2003 8:36:04 PM
RE: How do I back up the database? Posted by Boudewijn Lutgerink @ 11/23/2003 7:29:28 AM
RE: How do I back up the database? Posted by Richard Conlan @ 11/24/2003 2:41:36 PM
RE: How do I back up the database? Posted by Boudewijn Lutgerink @ 11/25/2003 11:15:26 AM
RE: How do I back up the database? Posted by Richard Conlan @ 11/25/2003 4:28:27 PM
Why is it so hard to back up the database!? Posted by Richard Conlan @ 11/26/2003 2:45:55 PM
RE: Why is it so hard to back up the database!? Posted by Boudewijn Lutgerink @ 11/27/2003 1:09:19 PM
RE: Why is it so hard to back up the database!? Posted by Richard Conlan @ 12/1/2003 3:36:26 PM
RE: Why is it so hard to back up the database!? Posted by Craig Moore @ 12/1/2003 3:48:50 PM
RE: Why is it so hard to back up the database!? Posted by Richard Conlan @ 12/2/2003 7:03:55 PM
RE: Why is it so hard to back up the database!? Posted by Boudewijn Lutgerink @ 12/3/2003 8:06:27 AM
RE: Why is it so hard to back up the database!? Posted by Richard Conlan @ 12/11/2003 9:41:09 PM
RE: Why is it so hard to back up the database!? Posted by Boudewijn Lutgerink @ 12/12/2003 9:01:12 AM
RE: Why is it so hard to back up the database!? Posted by Richard Conlan @ 12/12/2003 2:53:07 PM