Article View: borland.public.cppbuilder.database.ado
Article #3304Re: Compact Access Database
From: Vassiliev V.V.
Date: Tue, 22 Oct 2002 15:45
Date: Tue, 22 Oct 2002 15:45
40 lines
2116 bytes
2116 bytes
Import
Microsoft Jet and Replication Objects 2.x Library
#include <JRO_TLB.h>
...
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IJetEngine * JetEngine = NULL;
CoCreateInstance(CLSID_JetEngine, NULL, CLSCTX_INPROC_SERVER,
IID_IJetEngine,
(void**) &JetEngine);
WideString Source = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\Test\\Test.mdb;";
WideString Dest = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\Test\\Compacted.mdb;";
JetEngine->CompactDatabase(Source.c_bstr(), Dest.c_bstr());
JetEngine->Release();
}
You can compact database from one file into another. There should be no
users connected to database.
----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server and MS Jet (MS Access) databases.
"boll" <bollitec@web.de> ???????/???????? ? ???????? ?????????:
news:ap39i6$8mk$04$1@news.t-online.com...
> I look for an simple "ADOCommand" to compact an AccessDB truh an
> ADOConnection.
>
> Has anybody an idea?
>
>
Technical Details
Message-ID:
<3db64003@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!telocity-west!TELOCITY!cyclone2.usenetserver.com!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<ap39i6$8mk$04$1@news.t-online.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,f0d3e3fdee8f87de X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-10-22 23:42:06 PST From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> Newsgroups: borland.public.cppbuilder.database.ado References: <ap39i6$8mk$04$1@news.t-online.com> Subject: Re: Compact Access Database Date: Tue, 22 Oct 2002 19:45:28 +0400 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.188.96.33 Message-ID: <3db64003@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1035354115 212.188.96.33 (22 Oct 2002 23:21:55 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!telocity-west!TELOCITY!cyclone2.usenetserver.com!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail