0
當我試圖壓縮我的Access 2010數據庫(無密碼),我收到錯誤消息類未註冊我正在使用Visual Studio 2010,我不知道這個問題是什麼。這裏是我正在使用的代碼:壓縮數據庫錯誤消息
Private Sub Compactdb()
Dim JRO As JRO.JetEngine
JRO = New JRO.JetEngine
'The first source is the original, the second is the compacted database under an other name.
JRO.CompactDatabase("Provider=Microsoft.Jet.OLEDB.5.0;Data Source=C:\Forte\Ex.mdb; Jet OLEDB:Engine Type=5", "Provider=Microsoft.Jet.OLEDB.5.0;Data Source=C:\Forte\Temp.mdb; JetOLEDB:Engine Type=5")
'Original (not compacted database is deleted)
System.IO.File.Delete("C:\Forte\Ex.mdb")
'Compacted database is renamed to the original databas's neme.
Rename("C:\Forte\Temp.mdb", "C:\Forte\Ex.mdb")
'User notification
MsgBox("The database was compacted successfully")
End Sub
如果我改變Jet.OLEDB.5.0到4.0,我得到無法識別DATABSE格式的不同的錯誤消息