Article View: borland.public.cppbuilder.database.ado
Article #3181Re: Question for compress Access DB
From: Vassiliev V.V.
Date: Sun, 01 Dec 2002 11:55
Date: Sun, 01 Dec 2002 11:55
128 lines
5005 bytes
5005 bytes
Include Jro_tlb.cpp into your project (you can get it by importing Jet type
library).
You can also use
#include <ComObj.hpp>
try
{
HRESULT hr = JetEngine->CompactDatabase(Source.c_bstr(), Dest.c_bstr());
OleCheck(hr);
}
__finally
{
JetEngine->Release();
}
instead of
JetEngine->CompactDatabase(Source.c_bstr(), Dest.c_bstr());
JetEngine->Release();
if you need to check an error
About BCB5 and BCB6 on the same machine - exclude all links to BCB\Imports
and BCB\Lib and BCB\Project (generally BCB\*) from your PATH. They can
coexist.
----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server and MS Jet (MS Access) databases.
"Daryl" <stockd@cqnet.com.au> �������/�������� � �������� ���������:
news:3de92627@newsgroups.borland.com...
> Hi
> I logged on last night to ask the same question, could not believe my luck
> when I saw this post. I attempted to compile my application after adding
> the example code and I received the following linker errors.
>
> [Linker Error] Unresolved external 'Jro_tlb::ID_IJetEngine 'referenced
from
> F:\MY DOCUMENTS\ACCESS2000\VIDEOSTORE\MAIN.OBJ
>
> and
>
> [Linker Error] Unresolved external 'Jro_tlb::CLSID_JetEngine 'referenced
> from F:\MY DOCUMENTS\ACCESS2000\VIDEOSTORE\MAIN.OBJ
>
> I have included JRO_TLB.H in the header file, the other variables in the
> function CoCreateInstance can be found/viewed by highlighting using the
CTRL
> key and selecting it. I have run out of ideas so any help would be very
> good...
>
> Actually, I have been having quite a few problems with linker errors since
I
> have installed BB6 pro, I have left BB5 pro installed - I am now starting
to
> wonder if BB6 upgrade was a good move, especially as all my applications
> have had difficulty with the new environment.
>
> Features that use automation (EXCEL APP) have had to have major work to
get
> them to compile, I am still having problems with EXCEL.EXE hanging around
in
> memory (which causes problems to other apps using it). I had this all
> sorted out with BB5 but for some reason the same techniques do not work
with
> BB6.
>
> You can also see other recent posts about Linker errors when trying to set
> ADO dataset properties, these also worked well in BB5, now will not link
in
> BB6. The solution may be to remove BB5 and BB6 and reinstall only BB6, I
> have been steering away from that due to having to get another activation
> key.
>
>
> Daryl
>
> "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> wrote in message
> news:3de87c27@newsgroups.borland.com...
> > 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,
> > Vassiliev V.V.
> > http://www.oledbdirect.com
> >
> > "adward" <adward_lee@seed.net.tw> �������/�������� � �������� ���������:
> > news:3de8421d@newsgroups.borland.com...
> > > Hi,
> > >
> > > does anyone kown how to compress Access Database in C++ Builder 6.0?
> > >
> > > Thanks!!
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID:
<3dea0d97@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3de8421d@newsgroups.borland.com> <3de87c27@newsgroups.borland.com> <3de92627@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,88e5d58e39a323f7 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-12-01 05:38:53 PST From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> Newsgroups: borland.public.cppbuilder.database.ado References: <3de8421d@newsgroups.borland.com> <3de87c27@newsgroups.borland.com> <3de92627@newsgroups.borland.com> Subject: Re: Question for compress Access DB Date: Sun, 1 Dec 2002 14:55:57 +0300 Lines: 130 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.99.56 Message-ID: <3dea0d97@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038749079 212.188.99.56 (1 Dec 2002 05:24:39 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail