Article View: borland.public.cppbuilder.database.ado
Article #2938Re: compacting mdb
From: Vassiliev V.V.
Date: Sat, 08 Feb 2003 07:25
Date: Sat, 08 Feb 2003 07:25
40 lines
2207 bytes
2207 bytes
Import type library:
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, MS Jet (MS Access)
and Interbase (LCPI provider, http://ibp.lcpi.lipetsk.ru) databases.
"Gabriel Martinez" <gabotz@fibertel.com.ar> �������/�������� � ��������
���������: news:3e43c5f7@newsgroups.borland.com...
> is there a way to compact an access database from c++ builder. some code
may
> help, thanks
>
>
Technical Details
Message-ID:
<3e44be76@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3e43c5f7@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,e8d7ebe14cab55db X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-02-08 00:38:52 PST From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> Newsgroups: borland.public.cppbuilder.database.ado References: <3e43c5f7@newsgroups.borland.com> Subject: Re: compacting mdb Date: Sat, 8 Feb 2003 10:25:38 +0300 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 212.188.96.81 Message-ID: <3e44be76@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1044692598 212.188.96.81 (8 Feb 2003 00:23:18 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail