LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drop Table vi in Database Connectivity not decreasing database file size?

Solved!
Go to solution

Hi,

 

I've created an access database for use in my project to log data.

 

So I was simulating a months worth of data to see how big the db file would get in a month - so as to not run out of space on my cRIO -, and it got to 6MB.  After I did that, I used the Drop Table vi to delete all the tables...however, the file size did not decrease at all?

 

Now this worries me as I'm not sure what will happen in the field.  Why is the file still so large with no data in it (apparently)? 

Am I doing something wrong?

 

Any help will be appreciated. 

 

Regards

Mark

0 Kudos
Message 1 of 6
(2,874 Views)
Solution
Accepted by topic author markza

Dropping or deleting the table from an MS Access database does not automatically free the space used by that table.

 

The only way I know to reduce the size of an Access MDB file is to open it with MS Access and run Tools -> Database Utilities -> Compact and Repair Database...

 

You need exclusive access to the MDB file when doing this...


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 2 of 6
(2,866 Views)

As Phillip did mention, this issue is nothing with the Database Connectivity Toolkit. It is a general 'issue' with Access/Jet like it can be found out in a google-search which results in hits like this.

Please note that the behavior is exactly the same when working with Outlook Express/Windows Mail when deleting emails. Even if you empty your trash in Outlook/Mail, the size of the file on disk stays the same. If you select "Compress folders", the filesize will be reduced as expected.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 6
(2,861 Views)

Thanks guys - I've only ever used SQL so this is pretty new to me.  Plus that was in PC based software, never really worried about file size issues.

 

So there's no way to programatically do this within Labview?

0 Kudos
Message 4 of 6
(2,852 Views)

You cannot do this with the Database Connectivity Toolkit, but implement it on your own using the ActiveX of Access.

See attached screenshot:

AccessCompress.png

 

But please note that this approach needs unique access to the database file. So you must not access the same database file in parallel by Database Connectivity when compressing.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 6
(2,849 Views)

Thanks, appreciate the help.

0 Kudos
Message 6 of 6
(2,844 Views)