Solved

VFP - Restore strategy

Posted on 2010-09-13
9
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

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…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

628 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