开发者

Compact Access 2007 DataBase File In C#

开发者 https://www.devze.com 2022-12-19 06:10 出处:网络
I want Compact a Access DataBas开发者_如何学Ce File in C# by Code. please Help me Edited: I USe Microsoft Access 2007 DataBase FileThe easiest way is going to be by using the standalone program “Jet

I want Compact a Access DataBas开发者_如何学Ce File in C# by Code. please Help me

Edited: I USe Microsoft Access 2007 DataBase File


The easiest way is going to be by using the standalone program “JetComp.exe” and just calling that from your c# code

http://download.microsoft.com/download/access2000/utility/1.0/win98me/en-us/jetcu40.exe

Another option would be to open a DAO connection to the database and use the .CompactDatabase method. Not being a c# bod I cant really offer a code sample but it is quite easy to do in VBA, for that reason I would just use the first option


I would use Jet Replication Objects (JRO). For example code, see here.


Not a C# programmer...but could you Shell to something like:

c:\myFolder\myAccessDatabase.mdb /compact

This as you can see uses the command line switch /compact.

0

精彩评论

暂无评论...
验证码 换一张
取 消