🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2265

Re: Pack AccesDB

#2265
From: Viatcheslav V. Vassiliev
Date: Mon, 22 Sep 2003 09:50
45 lines
2159 bytes
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,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Nicola" <.> �������/�������� � �������� ���������:
news:3f6eb50c@newsgroups.borland.com...
> Hi,
>
> how can I pack an MS Access database, I've read somewhere that i need to
use
> JRO library, but i don't remeber the way...
>
> thanks a lot
>
>
Technical Details
Message-ID: <3f6ec633$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!news.maxwell.syr.edu!skynet.be!skynet.be!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f6eb50c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,cf4020efddf666d3
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-09-22 03:06:06 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3f6eb50c@newsgroups.borland.com>
Subject: Re: Pack AccesDB
Date: Mon, 22 Sep 2003 13:50:24 +0400
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 213.234.218.42
Message-ID: <3f6ec633$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1064224307 213.234.218.42 (22 Sep 2003 02:51:47 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!news.maxwell.syr.edu!skynet.be!skynet.be!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail