Saving database on read-only media such as a CD (1 Viewer)

N

notyme4playin

Guest
I would like to know if there is a code out there that will disable the LDB files that open up automatically when you open your database. I would like to create back-ups of my database on a CD. Where and how do I set this up? Thank you
 

simongallop

Registered User.
Local time
Today, 02:33
Joined
Oct 17, 2000
Messages
611
Don't think that you can disable ldb. Why not copy the compacted db directly to the CD?
 

DBL

Registered User.
Local time
Today, 02:33
Joined
Feb 20, 2002
Messages
659
I've got this for saving my backend to a floppy. It uses the compact and repair procedure before saving the database, maybe you can adapt it.

stdresponse = MsgBox("The database will backup you data to drive A." & vbCr & vbCr & _
"Please wait a moment....", vbOKCancel)

If stdresponse = vbOK Then
DBEngine.CompactDatabase "C:\Program Files\Mailing Database\Mailing Database_be.mdb", "C:\Program Files\Mailing Database\Mailing Database_be1.mdb"
Kill "C:\Program Files\Mailing Database\Mailing Database_be.mdb"
Name "C:\Program Files\Mailing Database\Mailing Database_be1.mdb" As "C:\Program Files\Mailing Database\Mailing Database_be.mdb"

'Remove the file from the floppy or so the code can save the data
If Dir("A:\Mailing Database_be.mdb") <> "" Then Kill "A:\Mailing Database_be.mdb"
DBEngine.CompactDatabase "C:\Program Files\Mailing Database\Mailing Database_be.mdb", "A:\Mailing Database_be.mdb"
End If

I've left my own file paths in there but obviously you would need to change that to suit. Many thanks to Jack Cowley for the code in the first place.

HTH
 

DBL

Registered User.
Local time
Today, 02:33
Joined
Feb 20, 2002
Messages
659
Sorry, should have said that code is on a command button on my Main Menu.
 

Users who are viewing this thread

Top Bottom