Article View: borland.public.cppbuilder.database.ado
Article #5369Compacting MS Access Databases
From: Mike Collins
Date: Tue, 12 Jun 2001 16:01
Date: Tue, 12 Jun 2001 16:01
37 lines
2259 bytes
2259 bytes
Hi everyone, having a small problem with an Access 97 / 2000 database. I
need to impliment the compact & repair function that is avaliable within the
Acces IDE.
The problem is that my database is getting incresingly large, I think this
is because Access doesn't dellete records, it mearly flags them as being
deleted untill the database is compacted. This is also true for AutoNumber
keys, which should be re-ordered so that they start from 0 or 1 etc.
I've seen a few messages posted about compacting Access databases, but
knowone seems to have been able to achieve this with in Builder. I've also
been to the MS web-site and tried to impliment there code example into
Builder, but with know joy. The code I was using was:
#import "...\Common Files\System\ado\msjro.dll" no_namespace
#import "...\Common Files\System\ado\msado15.dll" no_namespace
try
{
IJetEnginePtr jet(__uuidof(JetEngine));
jet->CompactDatabase( required params etc);
}
catch(_com_error &e)
{
ShowMessage("Error");
}
- I get the message, "improper use of typedef", relating to the
IJetEnginePtr line.
I also thought that I might be able to execute the Compact & Repair command
throught a macro or VB module from within the access database, but again I
don't know if this is possible.
Sorry about the long message, any help would be much appreshialeted
Mike
Technical Details
Message-ID:
<3b263cee_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,64d8ccacc043eb65,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-06-12 09:13:58 PST From: "Mike Collins" <mcollins@tynetec.demon.co.uk> Newsgroups: borland.public.cppbuilder.database.ado Subject: Compacting MS Access Databases Date: Tue, 12 Jun 2001 17:01:48 +0100 Lines: 39 Organization: TyneTec X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 NNTP-Posting-Host: 194.222.126.108 Message-ID: <3b263cee_2@dnews> X-Trace: dnews 992361710 194.222.126.108 (12 Jun 2001 09:01:50 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews