G
Guest
I have a split database and want to compact my backend from the front end.
When I run the following code on a Windows 2000 machine, it seems to work
just fine. When I put the db on a Windows 98 machine and run the same code,
it always errors out. Can anyone tell me why and if this can be made to run
on W98?? The db was created using Access 2000. Thanks for any help!
Code:
-----------------------------------------------------------------------------
Function CompactRepairDB(DBSourceName As String) As Boolean
Dim DbDestName As String
DbDestName = Left(DBSourceName, Len(DBSourceName) - 3) & "NEW"
DBEngine.CompactDatabase DBSourceName, DbDestName
Kill DBSourceName
Name DbDestName As DBSourceName
CompactRepairDB= True
End Function
I've also tried:
Public Sub CompactDB()
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
End Sub
When I run the following code on a Windows 2000 machine, it seems to work
just fine. When I put the db on a Windows 98 machine and run the same code,
it always errors out. Can anyone tell me why and if this can be made to run
on W98?? The db was created using Access 2000. Thanks for any help!
Code:
-----------------------------------------------------------------------------
Function CompactRepairDB(DBSourceName As String) As Boolean
Dim DbDestName As String
DbDestName = Left(DBSourceName, Len(DBSourceName) - 3) & "NEW"
DBEngine.CompactDatabase DBSourceName, DbDestName
Kill DBSourceName
Name DbDestName As DBSourceName
CompactRepairDB= True
End Function
I've also tried:
Public Sub CompactDB()
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
End Sub