Bill-
Thanks a lot. I will download them all.
Best Regards,
Kevin
发自我的小米手机
在 "wrmosca@comcast.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2015年12月19日 上午1:05写道:
Kevin -I have used Karenware's Replicator for years to back up my databases every hour. It has never broken anything even while the databases were open. The URL is http://download.cnet.com/Karens-Replicator/3000-2242_4-50127.html
Be sure to look for all the other Karenware tools as the author has passed away and her site in no longer maintained.
Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.microsoft.com/en-us/PublicProfile/35852?fullName=Bill%20%20Mosca
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com
---In MS_Access_Professionals@yahoogroups.com, <zhaoliqingoffice@163.com> wrote :John-Thanks a lot. As I know, once I open the ms access, there will be two files, one is .accdb, the other is .laccdb. Is that possible to backup accdb once every hour while the .laccdb is still opening? Thanks. Is there third part apps to backup the backend? You know there're many users, it's hard to close the entire backend for backup purposes. Thanks.Best Regards,KevinDate: 2015-12-17 18:04Subject: Re: [MS_AccessPros] Backup toolsKevin-
If you are using my relink code, then you can do this on exit to do a backup. Note that this code must run in an unbound (no record source) form that has no combo box or list box controls. Most of my applications have a "frmMain" that is an unbound "switchboard" form for the user to get to the various parts of the app. The Exit code looks like this:Public Sub cmdExit_Click()Dim intErr As Integer, frm As Form, intI As Integer, strData As String, strDir As StringDim lngOpen As Long, datBackup As DateDim strLowBkp As String, strBkp As String, intBkp As IntegerDim db As DAO.Database, rst As DAO.RecordsetIf vbNo = MsgBox("Are you sure you want to exit?", vbYesNo + vbQuestion + vbDefaultButton2, _gstrAppTitle) ThenExit SubEnd If' Trap any errorsOn Error Resume Next' Make sure all forms are closedFor intI = (Forms.Count - 1) To 0 Step -1Set frm = Forms(intI)' Don't close myself!If frm.Name <> "frmMain" Then' Close the formDoCmd.Close acForm, frm.NameDoEventsEnd If' Note any error that occuredIf Err <> 0 Then intErr = -1Next intI' Log any error beyond hereOn Error GoTo frmMain_Error' Skip backup check if there were errorsIf intErr = 0 ThenSet db = DBEngine(0)(0)' Open ztblVersion to see if we need to do a backupSet rst = db.OpenRecordset("ztblVersion", dbOpenDynaset)rst.MoveFirstlngOpen = rst!OpenCountdatBackup = rst!LastBackuprst.CloseSet rst = Nothing' If the user has opened 10 times or last backup was more than 2 weeks ago...If (lngOpen Mod 10 = 0) Or ((Date - datBackup) > 14) Then' Ask if they want to backup...If vbYes = MsgBox("Management highly recommends backing up your data to avoid " & _"any accidental data loss. Would you like to backup now?", _vbYesNo + vbQuestion, gstrAppTitle) Then' Get the name of the data filestrData = Mid(db.TableDefs("ztblVersion").Connect, 11)' Get the name of its folderstrDir = Left(strData, InStrRev(strData, "\"))' See if the "BackupData" folder existsIf Len(Dir(strDir & "BackupData", vbDirectory)) = 0 Then' Nope, build it!MkDir strDir & "BackupData"End If' Now find any existing backups - keep only threestrBkp = Dir(strDir & "BackupData\MembershipBkp*.mdb") ' << Fix this nameDo While Len(strBkp) > 0intBkp = intBkp + 1If (strBkp < strLowBkp) Or (Len(strLowBkp) = 0) Then strLowBkp = strBkpstrBkp = DirLoopIf intBkp > 2 ThenKill strDir & "BackupData\" & strLowBkpEnd If' Now, setup new backup name based on today's date' **** FIX NAME OF FILE IN LINE BELOW ****strBkp = strDir & "BackupData\MembershipBkp" & Format(Date, "yymmdd") & ".mdb"' Make sure the target file doesn't existIf Len(Dir(strBkp)) > 0 Then Kill strBkp' Create the backup file using CompactDBEngine.CompactDatabase strData, strBkp' Now update the backup datedb.Execute "UPDATE ztblVersion SET LastBackup = #" & Date & "#", dbFailOnErrorMsgBox "Backup created successfully!", vbInformation, gstrAppTitleEnd If' See if error log has 20 or more entriesIf db.TableDefs("ErrorLog").RecordCount > 20 Then' Don't ask if they've said not to...If Not (DLookup("DontSendError", "ztblVersion")) ThenDoCmd.OpenForm "fdlgErrorSend", WindowMode:=acDialogElsedb.Execute "DELETE * FROM ErrorLog", dbFailOnErrorEnd IfEnd IfEnd IfSet db = NothingEnd If' We're outta here!frmMain_Exit:On Error GoTo 0DoCmd.Close acForm, Me.NameApplication.Quit acSaveNoneExit SubfrmMain_Error:ErrorLog "frmMain", Err, ErrorResume frmMain_ExitEnd SubThe first thing the code does is close all forms except "frmMain" where this code is running. If you're using my relink code, then you built a ztblVersion in the back end database. Every 10 times the app is opened (count is kept in ztblVersion), it offers to create a backup on close, and it keeps up to three copies in a subfolder called BackupData.John Viescas, AuthorMicrosoft Access 2010 Inside OutMicrosoft Access 2007 Inside OutMicrosoft Access 2003 Inside OutBuilding Microsoft Access ApplicationsSQL Queries for Mere Mortals(Paris, France)On Dec 17, 2015, at 1:16 AM, zhaoliqingoffice zhaoliqingoffice@163.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:Dear All,Is there free backup tools out there for backing up backends. Thanks.Best Regards,Kevin
__._,_.___
Posted by: zhaoliqingoffice <zhaoliqingoffice@163.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (7) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar