Hi. I wonder whether someone could advise me on the following, please.
I recently encountered the MSysDb error-message on an Access 2021 database I've been developing.
"The Microsoft Access database engine could not find the object 'MSysDb'. Make sure the object exists and that you spell its name and the path correctly. If 'MSysDb' is not a local object, check your network connection or contact the server administrator'.
The database won't open at all.
My backup was created too long ago......(I can only say that with the benefit of hindsight !). I'd really like to be able to recover the latest version.
I've tried importing the database objects into a new Access file, but that doesn't work. (I get the above error-message).
I'm now trying to force a compact-and-repair of the database from a separate Access file, using the following :
However, I'm getting the error-message :
"Run-time error '7847'
C:\Users\USER\Documents\Database101.accdb already exists. Microsoft Access must create a backup of your file before you perform the repair operation. Enter a name for the backup file."
End | Debug | Help
What do I need to do to get this VBA to work ?
TIA
I recently encountered the MSysDb error-message on an Access 2021 database I've been developing.
"The Microsoft Access database engine could not find the object 'MSysDb'. Make sure the object exists and that you spell its name and the path correctly. If 'MSysDb' is not a local object, check your network connection or contact the server administrator'.
The database won't open at all.
My backup was created too long ago......(I can only say that with the benefit of hindsight !). I'd really like to be able to recover the latest version.
I've tried importing the database objects into a new Access file, but that doesn't work. (I get the above error-message).
I'm now trying to force a compact-and-repair of the database from a separate Access file, using the following :
Code:
Sub CompactRepairDatabase()
Dim strDB As String
strDB = "C:\Users\USER\Documents\Datebase101.accdb"
'Compact and repair the database
Application.CompactRepair SourceFile:=strDB, DestinationFile:=strDB
MsgBox "Done", vbInformation
End Sub
However, I'm getting the error-message :
"Run-time error '7847'
C:\Users\USER\Documents\Database101.accdb already exists. Microsoft Access must create a backup of your file before you perform the repair operation. Enter a name for the backup file."
End | Debug | Help
What do I need to do to get this VBA to work ?
TIA