469,292 Members | 1,310 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,292 developers. It's quick & easy.

how to save the database in vba?


I dont seem to find a way to save the current database in Access, I just want to do same thing as the Save-button or save-as-button of Access, is there some kind of VBa-code?
like currentdatabase.save???

In fact I want to make an automatic back-up routine, and thought to do this by saving ervy 10 minutes to another name and saving back to the original...
I have had problems myself with access and losing much data...

Jan 23 '12 #1

✓ answered by NeoPa

There is no such facility in Access Plynius. You would need to make a copy of the whole database file (when it's not in use preferably).

8 11016
759 512MB
Is no reason to do that because each time a record is updated all modifications are saved automatically. You do not risk to loose data as in Excel (for example) where is needed to push the Save button after you modify something in the sheet.
Jan 23 '12 #2

I wanted to make a back-up system, so safe the file to another name. Or is there another way to do so?

thanks for answering my question
Jan 23 '12 #3
759 512MB
Copy the file then rename it as you wish.
Jan 23 '12 #4
32,173 Expert Mod 16PB
There is no such facility in Access Plynius. You would need to make a copy of the whole database file (when it's not in use preferably).
Jan 23 '12 #5
Seth Schrock
2,962 Expert 2GB
If you do backups on your computer, just add the folder that contains the database to the backup list. There are many options for backing up a file of any kind automatically. You can do online backups through websites such as dropbox.com which backs up the selected folders whenever there is a change. You can also use the backup tools that come with Windows OS and Mac OS. I'm pretty sure that Linux also comes with a built-it backup tool. All you would need is an external hard drive or another computer. You can then do scheduled backups. Do a Google search for how to back up your computer and you will find many options. If your computer is backed up and your computer crashes, then you can restore your database from the backup. However, like NeoPa said, this isn't done through Access.
Jan 24 '12 #6
2,321 Expert Mod 2GB
There are things you can do from within access, but it depends on the nature of your application. Are you the only user, or are there multiple users for instance?

In some cases it could be as simple as having a procedure that creates a copy of the database when the user logs on.

Another option could be to use a system like KeepIt.Com for taking online backup.

I would not recommend DropBox for taking backup. If you have your db located in a dropbox synchronized folder it can severely affect performance and increase the risk of corruption.

If corruption is the main cause of your data loss, I can add that I used to experience a fair share of database corruption in Ac2003, but after following these simple steps I have had no corruption since then:
  1. Never edit running code. If your in debug mode, its fine to see where the error is occuring, but after you've viewed the location, kill the process.
  2. Do your edits, then Compile.
  3. Only run compiled code.
Jan 24 '12 #7
759 512MB
Good to know, Smiley !
Jan 24 '12 #8
Thx for the hints everyone, Im trying just to copy the file automaticaly in access every 15 minutes...
Jan 25 '12 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Andras Gilicz | last post: by
6 posts views Thread by Josetta | last post: by
1 post views Thread by sajithamol | last post: by
5 posts views Thread by dancer | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.