Hi,
I'm trying to create code that will use the repair and compact database methods so a user can repair and compact a database with the click of a command button.
This is the code that I have so far and as soon as the first line is executed the project closes and none of the other lines are executed. Can anyone see what I'm doing wrong? I'm fairly certain I have to close the database before I use the repair or compact method.
In the code below "CatalogDB" is the name of my backend database:
Me.Application.CloseCurrentDatabase
DBEngine.RepairDatabase Me.Application.CurrentProject.Path & "\CatalogDB.mdb"
DBEngine.CompactDatabase Me.Application.CurrentProject.Path & "\CatalogDB.mdb", _
Me.Application.CurrentProject.Path & "\CatalogDB.mdb"
Me.Application.OpenCurrentDatabase (Me.Application.CurrentProject.Path & "\CatalogDB.mdb"
Does anyone see anything I'm doing wrong?
Thanks,
MBaddar
I'm trying to create code that will use the repair and compact database methods so a user can repair and compact a database with the click of a command button.
This is the code that I have so far and as soon as the first line is executed the project closes and none of the other lines are executed. Can anyone see what I'm doing wrong? I'm fairly certain I have to close the database before I use the repair or compact method.
In the code below "CatalogDB" is the name of my backend database:
Me.Application.CloseCurrentDatabase
DBEngine.RepairDatabase Me.Application.CurrentProject.Path & "\CatalogDB.mdb"
DBEngine.CompactDatabase Me.Application.CurrentProject.Path & "\CatalogDB.mdb", _
Me.Application.CurrentProject.Path & "\CatalogDB.mdb"
Me.Application.OpenCurrentDatabase (Me.Application.CurrentProject.Path & "\CatalogDB.mdb"
Does anyone see anything I'm doing wrong?
Thanks,
MBaddar