[AccessD] Compact & Repair (Urgent)

paul.hartland at fsmail.net paul.hartland at fsmail.net
Mon Jun 27 04:57:08 CDT 2005


This is a snippet of code I used to use, if anyone has a better way I would also like to see it:

Dim MyDate As String
    MyDate = Left(Date, 2) & "_" & Mid(Date, 4, 2) & "_" & Right(Date, 2)
    FileCopy "Database", "Database_Backup" & MyDate & ".mdb"
    DBEngine.CompactDatabase "Database_Backup"& MyDate & ".mdb", "Database_Compact"
    Kill "Database"
    Name "Database_Compact" As "Database"

Database = Original Database
Database_Backup = Backup (Just in case of an OOPS)

Database_Compact = Name of database once compacted & repaired



Message date : Jun 27 2005, 10:43 AM
>From : "Sad Der" 
To : "Acces User Group" 
Copy to : 
Subject : [AccessD] Compact & Repair (Urgent)
Hi,

I forgot my CD's from the ADHB2K. I've got the book
here but I cannot seem to find the code to compact and
repair an access database.

Has anyone got it or knows where in the book I can
find it?

Thnx!!!!!!!!

Regards,

SD



____________________________________________________ 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm


More information about the AccessD mailing list