Does anyone have some insight as to how to make this happen via code?
Thanks!
Drk.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Export Database as Time/Date
Hmm…
Well, if I cant *duplicate?* or make a replica of the database daily, perhaps I can export a table as time-date? or multiple tables?
All I really need is a daily backup of the data incase my problems re-occur… (The original programmer used strictly macros, which added a whole lot of junk to the code making it unstable.. any changes made to a report or form would result in complete data corruption…)
Hope this clarifies a bit!
Drk.
Hi Drk,
My .Forgive me for being so bold, but why would you want to do this in Access?
On the surface, it would appear that there are many ways to do this, such as using some program to automatically zip up a current copy of the DB and to rename the zip file to a date/time name. Even a DOS batch file can do that.
Is there some limiting factor here that we don’t understand?
Not to worry.. bold is good!
The problem is in the user base. If I can make Access do this ‘behind the scenes’ that would be preferrable. Because a DOS batch file or other outside resource requires another file, My concern is that it wont work if changes are made to file locations, etc..etc..etc… There’s also a security factor.. although anyone can get the data if they want it, I don’t want to blatently announce the locations of the data by writing a batch file, as the data is sensitive.
Hope that helps!
Drk.
Just a thought.
Just prior to the Application.Quit, (using code, of course) open up another .mdb file which would contain the copydb code. You can then fire the code in the open event of the startup form (or autoexec macro, if you must). Be sure to check for the abscence of the matching .ldb to ensure noone else is using the mdb (thereby possibly losing data among other problems)
The easiest would be, (in access) run a shell command such as the following:
Shell “c:program fileswinzipwinzip32.exe -min -a ” & fullPathAndFilenameToCreate & ” ” & fullPathAndFilenameToZip
which would create a.zip file containing the .mdb and name it whatever name you assign to the fullPathAndFilenameToCreate variable
This assumes you have a liscenced copy of winzip in the difined location
Hi Drk,
I tried it copying a specific table to another mdb. Try this bit of code:
Sub CopyTable()
Dim NewTableName As String
Dim OldTableName As String
Dim myDestinationDB As String
myDestinationDB = “F:KenMAccessDevTestDB.mdb”
NewTableName = “tblRecov_” & Now()
OldTableName = “tblRecov_Bak”
With Application
.DoCmd.CopyObject , NewTableName, acTable, OldTableName
.DoCmd.TransferDatabase acExport, “Microsoft Access”, myDestinationDB, acTable, NewtableName, NewtableName, 0, True
.DoCmd.DeleteObject acTable, NewtableName
End With
End Sub
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications