Solved

VFP - Restore strategy

Posted on 2010-09-13
9
363 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

16 Experts available now in Live!

Get 1:1 Help Now