Code to automatically export all tables to a backup with date as name

H

Henro

I made this database for which I need an alternate backup strategy:
What I am actually looking for is code in a frontend that, on opening, will
export all the tables (in the backend) to a new database that has a unique
name.
(preferrably it should have the date in it)
Is there anyone that has such a code?

Thnx in advance!

Henro
 
R

Rick Brandt

Henro said:
I made this database for which I need an alternate backup strategy:
What I am actually looking for is code in a frontend that, on opening, will
export all the tables (in the backend) to a new database that has a unique
name.
(preferrably it should have the date in it)
Is there anyone that has such a code?

Actually if you have a split application you can either use FileCopy or code to
compact the back end to a new file name that you specify. This would be a lot
easier than exporting the tables individually.
 
H

Henro

That's a good idea, especially the second one sounds like just what I need!
Can you give me any hints as how this code should look?

I am very far of being a code wizard, that's why............

Thanks!

Henro.
 
R

Rick Brandt

Henro said:
That's a good idea, especially the second one sounds like just what I need!
Can you give me any hints as how this code should look?

I am very far of being a code wizard, that's why............


DBEngine.CompactDatabase "Path to BE.mdb", "BE" & Format(Date, "yyyymmdd") &
".mdb"
 
H

Henro

And what if the backend is password protected?
I tried the code but is says: "not a valid password"

Suggestions?
 
R

Rick Brandt

Henro said:
And what if the backend is password protected?
I tried the code but is says: "not a valid password"

Suggestions?

How are you able to link to it then? Sorry I'm not that familiar with the
password feature. Everything I've read says that it is so easy to circumvent
that you might as well get rid of it.
 
H

Henro

I used the filecopy method using something I found at Microsoft.
(http://support.microsoft.com/default.aspx?scid=kb;en-us;207703&Product=acc2
000) combined with your method to give the database a new name every day.
The password has to be entered only once, when linking the FE to the BE. As
long as you do not need to relink the connection/password is transparant.

It is not for security that I use it, I just don't want my collegues
rummaging around in the tables. This way they know they have to stay out :p

Grtz Henro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Compacting to a new database 0
Need help modifying code 0
compact/repair/backup with VBA 5
Backups 4
Network Share 1
Export ExcelWorkbook xlsx format 1
CompToNewMDB 2
Exporting to Excel from Access 3

Top