Below is the code I tried: Method1: Dim JRO As New JRO.JetEngine JRO.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= " & "C:\tempDB.mdb", "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & mdwfilename & ";Jet OLEDB:Engine Type=5") Method2: Dim app As New Microsoft.Office.Interop.Access.Application Dim tempFile As String = "C:\tempDB.mdb" app.CompactRepair(mdwfilename, tempFile, False) app.Visible = False Dim temp As FileInfo = New FileInfo(tempFile) temp.CopyTo(mdwfilename, True) temp.Delete()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)