Re: Compact/Repair Access 2007 database



Andy wrote:
What component should I get to compact and repair Access 2007 databases. I used to use Adonis JRO to do this but it does not support .accdb 2007 files.
Thanks in advance.

Andy
Import the type library from msjro.dll
Then
procedure TfrmLog.mnuCompactDBClick(Sender: TObject);
var
wholePath: string;
JE: TJetEngine;
begin
wholePath := WritePath + FOLDER_NAME + DBName;
if FileExists(WritePath + FOLDER_NAME + 'compacted.mdb') then
DeleteFile(WritePath + FOLDER_NAME + 'compacted.mdb');
if FileExists(wholePath) then
begin
//close the database here
JE:= TJetEngine.Create(Application);
try
try
JE.CompactDatabase(SProvider1 + wholePath, SProvider1 + WritePath + FOLDER_NAME + 'compacted.mdb');
except
on E:Exception do
ShowMessage(E.Message);
end;
finally
JE.FreeOnRelease;
if FileExists(WritePath + FOLDER_NAME + 'compacted.mdb') then
begin
DeleteFile(wholepath);
RenameFile(WritePath + FOLDER_NAME + 'compacted.mdb', wholepath);
// reopen the database
end;
end;
end;

Mike
.



Relevant Pages

  • Compact/Repair Access 2007 database
    ... What component should I get to compact and repair Access 2007 databases. ... I used to use Adonis JRO to do this but it does not support .accdb 2007 files. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Compact/Repair Access 2007 database
    ... databases. ... I used to use Adonis JRO to do this but it does not ... support .accdb 2007 files. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: What so special about PostgreSQL and other RDBMS?
    ... That's exactly the link the licence agreement for the database points to when it ... comes to what wecan expect for paying support. ... > "Oracle may provide additional releases or versions of its programs ... If the requirements are volatile I'd do a long term contract detailing what ...
    (comp.lang.php)
  • Re: What so special about PostgreSQL and other RDBMS?
    ... > the porting to another database won't be significantly eased. ... not terribly significant and the abstraction can be kept very light ... >> If they where a credible provider of support and development for this ... >> services, exactly like Oracle does, but without trapping you into a ...
    (comp.lang.php)
  • RE: Repairing / modyfing Exchange
    ... Customer Service and Support for more immediate assistance. ... This service gives you access to Microsoft technical support engineers who ... database by using the old Server's database files, ... >> up with the First Storage Group, so you would like to delete it and then ...
    (microsoft.public.windows.server.sbs)