Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VFP - Restore strategy

Posted on 2010-09-13
9
Medium Priority
?
416 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 2000 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Screencast - Getting to Know the Pipeline
Suggested Courses

876 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