Article View: borland.public.cppbuilder.database.ado
Article #5306Final Question on Compacting Access Databases
From: Mike Collins
Date: Tue, 19 Jun 2001 11:49
Date: Tue, 19 Jun 2001 11:49
69 lines
2820 bytes
2820 bytes
Does anyone know if it IS POSSIBLE to compact an MS Access 2000 database
when connecting using ADO and the MS Jet Engine 4.
I've spent the last week trying to compact an Access database, I've been to
every site on the net which has a reference to this, and I've posted
numerouse questions. Nigal Jones pointed me in the direction of using the
Import Type Libaray to access the msjro.dll. I've done all this, pass what
I think are the correct parameter, compiled and run. And the result is
NOTHING. Please, please, please, if anyone knows how to achieve this in
C++Builder (not delphi), could you please post me. My code is below if
anyone cares to have a look:
//Project.cpp
USE("C:\Program
Files\Programming\Borland\CBuilder5\Imports\JRO_TLB.h", File);
//Main.cpp#pragma package(smart_init)
#pragma link "JRO_TLB"
#pragma resource "*.dfm"
TForm1 *Form1;
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
try
{
jet = CoJetEngine::Create();
jet->CompactDatabase(
WideString"Provider=Microsoft.Jet.OLEDB.4.0;DatSource=c:\\bob.mdb"),
WideString("Provider=Microsoft.Jet.OLEDB.4.0;Dat Source=c:\\biff.mdb;Jet
OLEDB:Engine Type=5"));
}
catch (...)
{
ShowMessage("Error");
}
}
//Main.h
#ifndef MainH
#define MainH
#include "JRO_TLB.h"
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <Db.hpp>
class TForm1 : public TForm
{
__published:
TBitBtn *BitBtn1;
void __fastcall BitBtn1Click(TObject *Sender);
private:
TCOMIJetEngine jet;
public:
__fastcall TForm1(TComponent* Owner);
};
//--------------------------------------------------------------------------
-
extern PACKAGE TForm1 *Form1;
//--------------------------------------------------------------------------
-
#endif
Technical Details
Message-ID:
<3b2f3c53_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,ec9907cfc07dfcb4,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-06-19 05:12:42 PST From: "Mike Collins" <mcollins@tynetec.demon.co.uk> Newsgroups: borland.public.cppbuilder.database.ado Subject: Final Question on Compacting Access Databases Date: Tue, 19 Jun 2001 12:49:36 +0100 Lines: 74 Organization: TyneTec X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 NNTP-Posting-Host: 194.222.126.108 Message-ID: <3b2f3c53_1@dnews> X-Trace: dnews 992951379 194.222.126.108 (19 Jun 2001 04:49:39 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews