Solved

VFP - Restore strategy

Posted on 2010-09-13
9
386 Views
Last Modified: 2012-05-10
Hi Experts

Accordingly the backup strategy you've gave before, do you have any restore strategy using the .zip file  formed in a daily basis ?

Thanks in advance !
0
Comment
Question by:Eduardo Fuerte
  • 5
  • 4
9 Comments
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
ID: 33661875
If you use my code for using Windows Explorer in Windows you can do the backwards now:

cTempPath is the user's temporary path
cTempZip is the temporary zip file location and filename
cSource is the backup file
cDirectory is the destination directory

cTempZip = cTempPath + SYS(3) + '.zip'
IF FILE(cTempZip)
      DELETE FILE (cTempZip)
ENDIF
COPY FILE (cSource) TO (cTempZip)
oShell = CREATEOBJECT("Shell.Application")
cDirectory = cTempPath + ADDBS(TTOC(DATETIME(),1))
IF NOT DIRECTORY(cDirectory)
      MD (cDirectory)
ENDIF
DECLARE INTEGER Sleep IN kernel32 INTEGER
nCount = oShell.NameSpace(cTempZip).items.Count
FOR EACH oFile IN oShell.NameSpace(cTempZip).items
      oShell.NameSpace(cDirectory).CopyHere(oFile)
      = Sleep(1000)
ENDFOR
CLEAR DLLS
0
 

Author Closing Comment

by:Eduardo Fuerte
ID: 33677621
Very clear
0
 

Author Comment

by:Eduardo Fuerte
ID: 33730300
Hello, Cyril

I don't know why the restore started to give an error (and it worked fine before) the directory is correctly created like before, but signs : File already exists...


If you prefer I could open another question...

Thanks in advance


img-21092010.JPG
img2-21092010.JPG
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 27

Expert Comment

by:CaptainCyril
ID: 33731449
It looks like you are using XP and don't have Acces Privileges problems.

And cDirectory is by date and time so it's a new directory and the files are not there.

Can you please try it if you hard code:
cDirectory is your temporary folder
"C:\Documents And Settings\<username>\...\Temp\TestDir"
Maybe your system is controlling something like Access Privileges and not letting the file to be copied and the error is misleading.
0
 

Author Comment

by:Eduardo Fuerte
ID: 33743940
Cyril

I couldn't do it yet but I will as soon as possible.

Amazingly it's run fine before and the OS had no new configuration done.

0
 

Author Comment

by:Eduardo Fuerte
ID: 33749671
Cyril

I've tried with no success... very strange.

What could it be... it was pretty good and the OS/ machine is pretty the same...

Thanks !
img-erro-230910.JPG
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 33751183
Please open the compressed file in Windows Explorer and drag the files inside to the directory cDirectory. See if you can do it manually.
0
 

Author Comment

by:Eduardo Fuerte
ID: 33752535
Sorry...

In the hurry I've introduced an error before the process itself so the error happened....so it's misunderstood me.

COPY FILE &cDestination TO &lcdrive and had not configured correctly the variables before the process...

==============================Início===============================================
EFUERTE # Eduardo 23/09/2010 07:56:31 PM
ERROR() = 1
MESSAGE() = File 'c:\geccvfp\&cdestination' does not exist.
MESSAGE(1) = COPY FILE &cDestination TO &lcdrive
PROGRAM() = RST_DBF2
PROGRAM(1) = MAIN
LINE() = 56
LINE(1) = 56
ALIAS =

Call Stack Level = 1
Current program filename= c:\geccvfp\main.fxp
Module or Object name= main
Module or Object Source filename= c:\geccvfp\main.prg
Line number in the object source file= 426
Source line contents= Read Events
----------------------------------------------------------            
Call Stack Level = 2
Current program filename= c:\geccvfp\rst_dbf2.fxp
Module or Object name= ON...
Module or Object Source filename= c:\geccvfp\rst_dbf2.prg
Line number in the object source file= 56
Source line contents=       COPY FILE &cDestination TO &lcdrive
----------------------------------------------------------            
===============================Término=============================================

Thanks for your patience in help me !

0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 33752731
You are welcome!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Activating an OLE Program 10 23
Report to PDF and TIF 33 1,447
Data Import from a CSV file 8 495
vfp-9 ole word automation error with word 2010/acrobat x 7 387
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question