Access 2007 protect compact and repair


Giovanni Roi

Dear Support,
I find this procedure to compact a Access 2007 data base in MSDN support and
when can I add the PASSWORD protection to this line of code:


Function RepairDatabase(strSource As String, _
strDestination As String) As Boolean
' Input values: the paths and file names of
' the source and destination files.

' Trap for errors.
On Error GoTo error_handler

' Compact and repair the database. Use the return value of
' the CompactRepair method to determine if the file was
' successfully compacted.
RepairDatabase = _
Application.CompactRepair( _
LogFile:=True, _
SourceFile:=strSource, _

' Reset the error trap and exit the function.
On Error GoTo 0
Exit Function

' Return False if an error occurs.
RepairDatabase = False

End Function


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question