Solved

VFP - Restore strategy

Posted on 2010-09-13
9
375 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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now