sivakumar
sivakumar

Reputation: 1577

How can we compact a access database in VB.NET or C#.NET without using DAO and JRO

I am using Access database. Now i compact the database by using DAO and sometimes using JRO. But to this both, we have add the COM reference.

I don't want to add the COM reference for compacting.

Is there any other way to compact an access database without using the COM reference(for DAO and JRO).

Kind help needed. Thanks.

Sivakumar.P

Upvotes: 0

Views: 3448

Answers (2)

JohnFx
JohnFx

Reputation: 34909

If the user has Access installed on their machine you could shell out and use the command line Syntax.

Something like: MSACCESS.EXE /compact

It might help to understand why you don't want to include the COM reference to answer more appropriately though.

Further Reading: Access Command Line Reference

Upvotes: 2

Chris John
Chris John

Reputation: 174

You could also try the Jet Compact utility: http://support.microsoft.com/kb/295334

This utility has a UI, but can also be called with command line switches:

jetcomp.exe -src:"C:\input.mdb" -dest:"output.mdb"

To get a full list of available switches:

jetcomp.exe -?

Upvotes: 5

Related Questions