Modules & VBA :: Create Backup Of Database On Exit In Different Directory
Dec 20, 2013I am looking to create a backup of a database on exit in a different directory then where I am storing the database now.
View RepliesI am looking to create a backup of a database on exit in a different directory then where I am storing the database now.
View RepliesHow to create backup for my table in another DB with VBA ....
View 3 Replies View RelatedIm trying to create a command that will create a backup of my access database once every week. here is the code I've got so far. it works, but not once a week but every time I start the access:
MsgBox ("Hello! Starting Backup procedure")
Dim DateOfBackup As Date
Dim strSourcePath As String
Dim strSourceFile As String
Dim strBackupFile As String
Dim SQL As String
[code]...
Hiya,
I have a database which on exit runs calls the following module and backs up the database to anther folder
Public Function BackupCopy()
'This function will allow you to copy a db that is open,
'You must set a reference to the 'Microsoft Scripting Runtime' for the CopyFile piece to work!
Dim fso As FileSystemObject
Dim sSourcePath As String
Dim sSourceFile As String
Dim sBackupPath As String
Dim sBackupFile As String
sSourcePath = "C:Database"
sSourceFile = "MyDB.mdb"
sBackupPath = "C:DatabaseBackups"
sBackupFile = "BackupDB_" & Format(Date, "mmddyyyy") & "_" & Format(Time, "hhmmss") & ".mdb"
Set fso = New FileSystemObject
fso.CopyFile sSourcePath & sSourceFile, sBackupPath & sBackupFile, True
Set fso = Nothing
Beep
MsgBox "Backup was successful and saved @ " & Chr(13) & Chr(13) & sBackupPath & Chr(13) & Chr(13) & "The backup file name is " & Chr(13) & Chr(13) & sBackupFile, vbInformation, "Backup Completed"
End Function
but after backing up correctly it brings me the following error
"Run-time errror '424':
Object required
any ideas what might be going wrong
Cheers
I have a fully functioning login screen with a combo box for name and a password box. It also has an option to create a new user or exit the database. On my main form I want the employees to have to log out of the database as opposed to close it out. How would I go about this? Also I need tracking login and logout times for each employee.
View 3 Replies View Relatedcome up with the below code to create PDF documents based on a query. It has been working great but I have a change that I need to make and can't figure it out. The code below creates all the documents in one folder "serverD$DocumentsInvoices" but I need it to create a separate folder for each PDF so that the file (Invoice1234.pdf) will be in the folder (serverD$DocumentsInvoicesInvoice1234Invoic e1234.pdf). That folder does not exist, so I need to create it and then save the PDF into it.
Code:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("Invoice_Report")
Set rst = qdf.OpenRecordset
[code]...
I need a way that I can simply have a User click a button on a form of the database and it will do automatically create a zip file of the entire database and start Outlook and attach the zip file and send it to me.....
View 4 Replies View RelatedNot sure where this question must be posted! I would like to create code in VBA to backup tables in access. I am not sure where to begin, but what I would like to do is the following:
When the user signs in I want to backup the database/tables
When the user sign off I want to back up the database/tables.
hello all and thanks in advance
here it what im trying to do
i have a client form to input client info
i want to take the address field and create a directory on a specified drive when i click a add record button and store that path in the table so i can call up files that will be scanned later.
been looking all over need help
B
I recently created a database with an FE and BE, and I want to be able to back up the BE from the FE. In the FE, I added a menu item "Back up database...", and it works good for the FE, but I want it to back up the BE, where the data is located. The reason that I like the menu item is that it opens a "Save Backup As" dialog box, and it also adds the date to the name of the database. Also it will be easier for the people that are using the db.
View 1 Replies View Relatedwhat would possibly cause a "Backup Database As" dialogue box to appear? it's the same as the "save as" box and allows you to save a copy of the access file you're working on but it says "Backup Database As" at the top.
it seems to come up periodically and im not sure what might be causing it.
thanks
Hi All,
I created a database in Access and of course password protected the backend version. As a matter of course I backed up the mdb to cd in case of emergency.
Our network has been taken down due to some virus being bought in by a laptop user so I wanted to reinstall the mdb from the cd to my c: drive.
The problem is that the file is saying that it is 'Read Only' which I think is down to the password protection i put on there.
Question:
Is there a way I can get round the security?
I promise I am not a hacker!
Cheers
Smudger
I read a lot of threads and some KB articles before this, but am still confused.
Can a copy of the BE database be made on the Server while users are logged on ? Max No. of users is 7.
Does copying a BE while work is going on lead to corruption in the database.
Right now i make a copy of the database thru code and then compress the copy for a backup.
We are currently running a FE / BE splitted database abd would like to back the back end up (to a sepearate location) every 15 minuutes by using the On Timer event.
Troiuble is, I believe I cant use the CopyDataBaseFile method whilst other users are in it and it would be too much hassle kicking everyone off!
Manually copying and pasting is good, but would really like to crack this one
Any suggestions please?
Regards
Andy
Attached i have a Database with 3 Tables.
-Table MA's. is the just a table were you can select if an Analyst is at the office or not. so if the check box is selected the analyst is available.
-Table Backups. We have Alias which is a reference code to a supplier the 1 Analyst and then Backup 1 and backup 2
-Table suppliers are just de supplier details.
what i whould need is when in the MA's table an Analyst is not selected a macro or query should search for backup 1 and replace it. when the backup 1 is not available as wel than backup 2 should be put in place.
When no backups are availeble then a message can put in the cell like"No Backup Available'.
This result can be put in a new table named. Decksplit with then the Supplier Alias, Supplier Name, Analyst
As my database is growing and hold more and more data i want to make a daily backup to the local hard disk (it works on a network now) automatically.The way i want it to work is as follows :
When a user quits the application i want to check if there is a copy already existing with the date of today.
If it does it skips the copy process and just quits.
If it doesn't, i want it to make a backup in a directory. if the directory doesn't exist it must be made.
The backup file name must hold the date of today off course.
I realize that i have to have a procedure to delete obsolete (outdated) backups as well, but ill worry about that later.
Off course Ive tried this a few times, otherwise i wouldnt ask it here. But i seem to fail every time..
Is it possible to create a command button on an Access switchboard that will automatically backup a database? What code would I need? The command button wizard doesn't handle this task.
View 14 Replies View RelatedI have developed an access database, and prepared its run time exe file. My question is how to develop the database so that the user can regularly backup the database?
View 1 Replies View RelatedI want backup my database automatically per week,what should I do?
View 1 Replies View RelatedI am trying to use VBA to backup the BACK-END of a split database (so I can automatically archive selected data). If I use FileCopy I get a message that the BACK-END database has not been found.Obviously I could 'unlink' the BACK-END, copy it and 're-link' it..Is it possible to copy the BACK-END tables(not just the links) into the FRONT-END and get at them that way?
View 2 Replies View RelatedI'd like to have a button on my dashboard that gives the user the ability to back up the database and save it with a different date. For example, existing database called "Fishing.accdb" and I'd like to have code behind a button that allows the database to be saved as "Fishing0711.accdb"
I'm trying to avoid the user having to go into the File Save as menu system....I've tried the docmd.copyObject method but can't get it to work
What I'd like to do is have an "export button", where the OnClick event, exports a single table into a new accde file. This would allow the end users to zip this file up and send it to me.
Because of all sorts of stupidity, I have no network capability and must send data back and forth via email.
I have digressed to a replication table that needs to be uploaded, once data is entered by the users...
Because the files can get relatively large (for emailing purposes), I am trying to figure out how I can get just one table from them vs. sending the whole application file back to me... It's pretty vital that they not be able to edit the table because that could really mess up the process.
So any way to create a new lock file from within the current Db?
Sometimes I find the 'need' to exit a subroutine from within a control 'loop' e.g. if.. then..else with... while... et al.
I suspect this is 'bad form' but is there any 'cost' in doing this?
There presumably will be if objects have been set and are not reset to Nothing. In this case it presumably is not a problem resetting to Nothing outside a With.. - what about inside a with..??
I'm using Access 2007, with what I think is a normal database that I've built up over the past month (maybe 15 tables, <1000 records, 20 queries, 4 or 5 reports and macros). I'm not an experienced Access programmer, so I don't think I'm doing anything fancy with security settings or any other such stuff. (If I have, it's surely by accident, not by intent.)
When I try to back up the db using the simple office button -> manage -> backup method, access generates a date-stamped backup filename and opens a file save dialog for me, but it ALWAYS fails to backup the database. I always get the same error message when I click save, whether I save on my machine, or on a network drive.
"Could not use '<path to the current database dir><backname>.accdb; file already in use."
This same error occurs when I create a new blank database with a single Table1 in it, so I don't think it's my database.
Does anyone have any idea why this might be happening? I scoured the net for help, but nothing. I checked various Access forums, but nothing. So I arrive here after I've done my homework... thanks
Why Access (2010) database is creating backup copy by itself?
View 2 Replies View RelatedI have tried to create an MDE database and receive the message "Microsoft Access was unable to create an MDE database" I deleted all unnecessary tables, queries, forms and reports and still receive this message.
how to fix this problem in MsAccess 2003?