in reply to Compressing an Access database

#!/usr/bin/perl -w use Win32::OLE; my $obj = Win32::OLE->CreateObject("Access.Application"); $obj->DBEngine->CompactDatabase("c:\\temp\\junk.mdb","c:\\temp\\foo2.m +db"); 1;

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: Compressing an Access database
by techcode (Hermit) on Sep 28, 2005 at 23:08 UTC
    If I remember right from my VB hacking days compacting database does a similar thing as when you empty your recycle bin on Windows.

    Old data that is no longer in the DB (deleted) still takes up space. Until you compact it. That might free up some space, but it doesn't really compress it in a true sense of that word.

    Have you tried freelancing? Check out Scriptlance - I work there.
Re^2: Compressing an Access database
by k_rajesh (Sexton) on Sep 30, 2005 at 19:40 UTC
    There is a problem here... since this is a hosted server, I have no idea of the full path of the mdb (c:\\temp\\junk.mdb, in your example)... but I do know the DSN name... is there anyway to do this compression with this constraint? Regards, Rajesh
      Actually ignore my question! It was pretty stupid actually... I used Cwd to figure out the fullpath :-)...now all I have to do is check whether the code works and come back here to thank you...