Jumat, 12 September 2014

Re: [MS_AccessPros] How to Make Menu Backup and Restore

 

Hi Bill
Here goes:



Public Sub BakUp(Newfile As String)

On Error GoTo err:
Dim CurrFile, Batfile, iFile

 'name the batch fie
 
 
 Batfile = Replace(Newfile, Dir(Newfile), "closeUpdate.bat")
   
   CurrFile = CurrentProject.Path & "\" & CurrentProject.Name
   
   'if this file exists delete it
   If Dir(Batfile) <> "" Then Kill Batfile
   
   
   'open a text fie and write the bat file commands to it
   iFile = FreeFile
   Open Batfile For Output As iFile
   
   'message
   Print #iFile, "echo Do Not close this file - it will autoclose in 10 seconds"
   
   
   'ping to an unavailable address - the 10 stands for no of seconds you want to wait before the next command is run
   'this is done to ensure that the file from which this bat file is run has time to close down before a nre file is overwritten on it
   Print #iFile, "ping 127.0.0.1 -n 10 > nu.txt"
   
   'this is the file copy command
   Print #iFile, "copy /y """ & CurrFile & """ """ & Newfile & """"
   
   Close #iFile


   'execult the batch file
   Shell Batfile
   
   
   'quit
   DoCmd.Quit
   
   


Exit Sub

err:
MsgBox err.Description


End Sub


Rajiv



On Fri, Sep 12, 2014 at 6:48 PM, 'Bill Singer' Bill.Singer@at-group.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
 

Rajiv,

I would love to see the process or code you have to make an automatic back up.  Too often I leave for the day and forget to make a back up.

Thanks

Bill

MN

 

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Thursday, September 11, 2014 2:27 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to Make Menu Backup and Restore

 

 

Dear Metazone63,
I agree with John - easiest way to do this is using a linked table.

However if you want to back up the whole db I have used the following alternative process:

Create a .bat file from Access with xcopy command. The file starts with a pause command so that the current db has time to close.
Run the bat file using shell command.
close the db.

I can give you the code if you need it

regards
Rajiv

On 11 Sep 2014 12:49, "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:

 

Dear matazone63 (name?)-

 

There are all sorts of ways to backup data in an Access database.  The simplest is to use a linked table to another "backup" database and run SQL to copy the data you need.

 

Do you just want to back up data for the current user's record in tb_User, or are there other associated records that you need to back up?  How do you identify the current user?

 

John Viescas, Author

Microsoft Access 2010 Inside Out

Microsoft Access 2007 Inside Out

Microsoft Access 2003 Inside Out

Building Microsoft Access Applications 

SQL Queries for Mere Mortals 

(Paris, France)

 

 

 

On Sep 11, 2014, at 8:48 AM, metazone63@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

 


Dear All,

Please help me, I want to ask how to make a menu for Backup and restore the data from the table?

Suppose a table with the name "tb_User", in the table there is data such as name, level (admin / user), etc.
The table will be backed up, but only to the level name "user" who is in the backup.

If the data in the table already in the backup, how to restore these backups?
Format backups, can sql or xml, or whatever lah.

Please help, thank you

 

 


__._,_.___

Posted by: Rajiv <torajiv@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

.

__,_._,___

Tidak ada komentar:

Posting Komentar