How do I compact and repair a database with a password
I'm trying to compact and repair a password protected database with the following code:
Public Sub Compact()
Dim CurrentFile As String, BackupFile As String
On Error GoTo 0
CurrentFile = "C:\CAV3\Database1.accdb"
BackupFile = "F:\Database1.accdb"
If Dir(BackupFile) > "" Then
Application.CompactRepair CurrentFile, BackupFile, True
Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.