mcdhappy80
Registered User.
- Local time
- Today, 19:56
- Joined
- Jun 22, 2009
- Messages
- 347
I've read that once compiled to .accde format, You cannot change the database. If I compile to .accde how would I then backup the data in tables?
I've read that once compiled to .accde format, You cannot change the database. If I compile to .accde how would I then backup the data in tables?
1. The database should be split (Frontend on each user's machine / Backend on server)
2. The Backend remains an ACCDB or MDB file.
3. The Frontend is an ACCDE.
4. You back up the backend.
The problem is that backing up can't really be done while the database is open.
Personally, I would split the database anyway so, if your frontend corrupts it doesn't take the data down with it.
You could use a batch file to do the backup. I've done this with my auto updating for frontends. It doesn't do the backup but it basically lets the user click okay, the database kicks off the batch file and then closes itself. The batchfile has a little delay built in so it doesn't try to delete the file before the database is closed. You could modify that batch file code to then copy the file instead of deleting it.
You can find my auto updater on my website (see link in my signature) and if you save the file and open the database (hold shift key) and go to the modules and find basFEUpdate and then the UpdateFrontEnd sub, you can see how I dynamically create the batch file. You wouldn't need to do that as you could just create it on your computer and then call it when needed.
You should be able to "Plug and Play" with my code from my website.. For now can someone help me with exporting table in excel format?
Dim strSaveAs As String
strSaveAs = CurrentProject.Path & "\Backup\" & YourNameVariableHere & ".xls"
xlWBk.SaveAs strSaveAs
I have some other questions regarding this thing:
When I hide the excel worksheet, it still remains open and can be seen in Windows Task Manager.
1) Can I close the Excel instance from VBA code after saving it?
xlWBk.Close
ApXL.Quit
Set ApXL = Nothing
Just use2) Can I create the folder from VBA where I want to save the excel file, and if I can can someone provide code for this?
If Dir("YourDirectoryPath") = "" Then
MkDir("YourDirectoryPath")
End If