本文介绍了紧凑型修复工作来自msaccess应用程序,但不是来自VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直面临着Compact& amp;从vb.NEt应用程序调用修复。
没有报告错误,但它无法解决问题。
然而,如果我在MSAccess中打开相同的mdb文件并修复它,它的工作原理!
我的尝试:
下面是我试过的代码:
方法1:
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)
方法2:
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 =新FileInfo(tempFile)
temp.CopyTo(mdwfilename,True)
temp.Delete()
解决方案
尝试子文件夹;某些操作无法在启动盘的根文件夹中执行。
I've been facing issues with Compact & Repair being called from vb.NEt application.
No errors reported, but it doesn't fix the problem.
Whereas if I open the same mdb file in MSAccess and repair it, it works!
What I have tried:
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()
解决方案
Try a "sub-folder"; some operations cannot be carried out in the "root folder" of the boot disk.这篇关于紧凑型修复工作来自msaccess应用程序,但不是来自VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!