Article View: borland.public.cppbuilder.database.ado
Article #1365Re: Compacting Database
From: Viatcheslav V. Vassiliev
Date: Tue, 27 Jul 2004 07:23
Date: Tue, 27 Jul 2004 07:23
94 lines
3984 bytes
3984 bytes
> > Import "Microsoft Jet and Replication Objects 2.x Library".
In IDE menu, choose "Project\Import type library" and import this library.
You will have jro_h.tlb in ($BCB)\Imports and jro_tlb.cpp will be included
into your project.
If you have no "Microsoft Jet and Replication Objects 2.x Library" in list
(very unlikely), install MDAC and Jet SP from
http://www.microsoft.com/downloads .
//------------------------------------------
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:41055e5c$1@newsgroups.borland.com...
> 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:
<410602f8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.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> <41055e5c$1@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: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <41052d23$1@newsgroups.borland.com> <41053e82@newsgroups.borland.com> <41055e5c$1@newsgroups.borland.com> Subject: Re: Compacting Database Date: Tue, 27 Jul 2004 11:23:39 +0400 Lines: 96 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 213.234.218.42 Message-ID: <410602f8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1090913016 213.234.218.42 (27 Jul 2004 00:23:36 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail