Microsoft Access 2010 データベースを圧縮しようとしています。VS 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.ACE.OLEDB.12.0;Data Source=\C:\Forte\Fortedb.accdb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\C:\Forte\Compactdb.accdb")
'Original (not compacted database is deleted)
System.IO.File.Delete("C:\Program Files\VSoft\AppMiss\NewAppDB.mdb")
'Compacted database is renamed to the original databas's name.
Rename("C:\Forte\Compactdb.accdb", "C:\Forte\Fortedb.accdb")
'User notification
MsgBox("The database was compacted successfully")
End Sub
私が今得ているエラーは
エラー 1 ファイル "\phipnasw01\users-hip$\cerns1\My Documents\Visual Studio 2010\Projects\Forte Data Gatherer\Forte Data Gatherer\Example1.accdb" を "bin\Debug\Example1.accdb" にコピーできません。ファイル '\phipnasw01\users-hip$\cerns1\My Documents\Visual Studio 2010\Projects\Forte Data Gatherer\Forte Data Gatherer\Example1.accdb' が見つかりませんでした。フォルテデータギャザラー