LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compacting an Access Database

Does anyone know how to compact an Access Database programmatically from LabVIEW?

Can the Database Connectivity Toolset be used?
0 Kudos
Message 1 of 9
(4,743 Views)
You can do it with ActiveX. It is the application DBengine.CompactDatabase method. I don't know about the Database Connectivity Toolset. I'm not familiar enough with all of the ADO properties and methods.
0 Kudos
Message 2 of 9
(4,742 Views)
Thanks for the information, I got it to work. However, what do I need
to include with the Application Builder when deploying my application
to a machine without Access?

Dennis Knutson wrote in message news:<506500000005000000274B0000-1004225886000@exchange.ni.com>...
> You can do it with ActiveX. It is the application
> DBengine.CompactDatabase method. I don't know about the Database
> Connectivity Toolset. I'm not familiar enough with all of the ADO
> properties and methods.
0 Kudos
Message 3 of 9
(4,745 Views)
I believe that at the minimum, you'll have to install the Access type library. I don't know anything about the license issues. I have something on my hard disk called AccessRuntime but I'm not sure were it came from or whether it work without installing full Access. But on another point, if you are compacting a network database, you will need to be very careful about doing that if you have your application running on multiple systems. It would not be a good idea to have one doing compaction while another is doing a read or write to the same database.
0 Kudos
Message 4 of 9
(4,744 Views)

HI,

This is exactly what I need to do, and it sounds like TLE was able to do it. If you could contact me to let me know how you were able to do this I would appreciate it. Thanks,

Ron Larson

0 Kudos
Message 5 of 9
(4,627 Views)
Hello,

I am experiencing a problem when calling the function to compact the database because it has a password. I can not input the password to the compact routine can I? I am simply feeding in the path to the routine to compact the database. I can not connect to the database first because the Compact routine has to use an exclusive connection. Does anyone have a VI that can do this?

--Kevin Shirey
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 6 of 9
(4,563 Views)
Hello,
 
I have been looking for a LabVIEW solution to compacting an MSaccess database but have not discovered one. I am just now trying jetcomp.exe from Microsoft. It allows the compacting to occur from a command line and does not need to open the database. The only drawback I see so far is that it will only make a compacted copy of the database, so you have to deal with renaming and deleting, etc.
 
Regards
0 Kudos
Message 7 of 9
(4,559 Views)
I have created a LabVIEW solution for the MS Access DB compressing issues we have all seen.

I am actually using the MS Access Compress and Repair function via Active X. There are ways to also use the Jet Engine to call the same function, but I could not get it to work using a required DB Password to be entered. The code uses the Database Toolkit from NI so I hope all of you have that. It also uses MS Access 2000 active X component. It should work for any version of Access, but it needs to be recompiled for different versions of Access. let me know if it works out for any of you.

The code allows to use a temp folder to create the compressed DB, or to put it in a backup folder of your choice. It also handles replacing the original database with the compressed one. The code finds the database given the connection reference being passed in. I use the ADO connection string to find the database location and the File DSN in order to reconnect to the database. I built it for my specific needs but I am sure any of you can customize it to your needs as well.

Thanks,

--Kevin


Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 8 of 9
(4,540 Views)

Hi,

If you run Jetcomp from command line you have many options including passwords. See bitmap for options when running >jetcomp -?. I have not tried with password but it does have options for passwords.

 

Regards,

Ron

0 Kudos
Message 9 of 9
(4,528 Views)