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
How do I change it to supply the password?
Thanks in advance.