Article View: borland.public.cppbuilder.database.ado
Article #1363Re: Compacting Database
From: Kim Utley
Date: Mon, 26 Jul 2004 19:41
Date: Mon, 26 Jul 2004 19:41
70 lines
2968 bytes
2968 bytes
I've performed a "dir /s jro_tlb.h" on my computer but cannot find the
header. Can someone please tell me where I can obtain it and the replication
objects library?
Kindest Regards,
Kim Utley
"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:41053e82@newsgroups.borland.com...
> When compacting Access db it must be disconnected. Compact always into
> another file. Later you may delete initial file and copy new file into its
> place.
>
> 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);
> try
> {
> 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());
> }
> __finally
> {
> JetEngine->Release();
> }
> }
>
> Compact will also repair database.
>
> //------------------------------------------
> Regards,
> Vassiliev V. V.
> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> ADO.Net
> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> MS Jet (Access) and Interbase (through OLEDB)
>
>
> "Kim Utley" <kim@simsware.com> �������/�������� � �������� ���������:
> news:41052d23$1@newsgroups.borland.com...
> > RE: BCB 6 and TADO... Objects
> >
> > Hi All,
> >
> > Can anyone provide a simple method for compacting a Microsoft Access
> > database file using TADO objects?
> >
> > I've looked at the MSDN website and saw a utility they provide but am
> > looking for a 'built-in' method to use within my application.
> >
> > Kindest Regards,
> >
> >
> > Kim L. Utley
> >
> >
>
>
Technical Details
Message-ID:
<41055e5c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41052d23$1@newsgroups.borland.com> <41053e82@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,b011e14d990002e1 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Kim Utley" <kim@simsware.com> Newsgroups: borland.public.cppbuilder.database.ado References: <41052d23$1@newsgroups.borland.com> <41053e82@newsgroups.borland.com> Subject: Re: Compacting Database Date: Mon, 26 Jul 2004 14:41:21 -0500 Lines: 72 Organization: SIMS, Inc. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 65.205.74.2 Message-ID: <41055e5c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1090870876 65.205.74.2 (26 Jul 2004 12:41:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail