要引用这个com对象
点机 项目 =-》 添加引用 -》会出现一个选项卡 -》 选择com -》 选择游览 -》 在把
msjro.dll 引用近来就可以了 ~~~(用 ctrl + alt + j 看 对象游览器 可以看见 )interop.jro路径 C:\Program Files\Common Files\System\ado\msjro.dll using JRO;
JetEngine x = new JetEngine();
x.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\test.mdb;","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\aa\\aa.mdb;Jet OLEDB:Database Password=aaa");原先 数据库 test.mdb 160k 没有密码 ,压缩后 124k 密码为aaa
点机 项目 =-》 添加引用 -》会出现一个选项卡 -》 选择com -》 选择游览 -》 在把
msjro.dll 引用近来就可以了 ~~~(用 ctrl + alt + j 看 对象游览器 可以看见 )interop.jro路径 C:\Program Files\Common Files\System\ado\msjro.dll using JRO;
JetEngine x = new JetEngine();
x.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\test.mdb;","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\aa\\aa.mdb;Jet OLEDB:Database Password=aaa");原先 数据库 test.mdb 160k 没有密码 ,压缩后 124k 密码为aaa
解决方案 »
- 请问高手们,条码打印机要怎么做?
- c#中读取二进制
- sql语句中不能包含()吗???
- 获取客户端在局域网中的地址
- 那里有web的net的treeview控件下啊
- 弹出新的窗体,在关闭旧窗体的时候,把新窗体也关闭掉了,请问是为什么?谢谢
- 在winfrm里,viewtree的节点有背景颜色或背景图片吗?有的话怎么加?谢就一个字
- Object reference not set to an instance of an object.这个错误怎么解决?
- 怎样在“数据窗口”的控件中使用ComboBox控件?
- 在百度搜索页面的HTML源码中如何过滤除了网址之外的HTML代码?
- 各位老大:如何在.cs程序中捕获 .js脚本的函数返回值.
- 如何在 C#中,处理 里面的 XML HTTP请求。初学。NET,多多指点。
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End With ' Make sure there isn't already a file with the
' name of the compacted database.
If Dir("NwindKorean.mdb") <> "" Then _
Kill "NwindKorean.mdb" ' This statement creates a compact version of the
' Northwind database that uses a Korean language
' collating order.
DBEngine.CompactDatabase "Northwind.mdb", _
"NwindKorean.mdb", dbLangKorean Set dbsNorthwind = OpenDatabase("NwindKorean.mdb") ' Show the properties of the compacted database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End WithEnd SubThis example uses the CompactDatabase method to change the version of a database. To run this code, you must have a Microsoft Jet version 1.1 database called Nwind11.mdb and you cannot use this code in a module belonging to Nwind11.mdb.Sub CompactDatabaseX2() Dim dbsNorthwind As Database
Dim prpLoop As Property Set dbsNorthwind = OpenDatabase("Nwind11.mdb") ' Show the properties of the original database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End With ' Make sure there isn't already a file with the
' name of the compacted database.
If Dir("Nwind20.mdb") <> "" Then _
Kill "Nwind20.mdb" ' This statement creates a compact and encrypted
' Microsoft Jet 2.0 version of a Microsoft Jet version
' 1.1 database.
DBEngine.CompactDatabase "Nwind11.mdb", _
"Nwind20.mdb", , dbEncrypt + dbVersion20 Set dbsNorthwind = OpenDatabase("Nwind20.mdb") ' Show the properties of the compacted database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
For Each prpLoop In .Properties
On Error Resume Next
If prpLoop <> "" Then Debug.Print " " & _
prpLoop.Name & " = " & prpLoop
On Error GoTo 0
Next prpLoop
.Close
End WithEnd Sub