Re: Compact/Repair Access 2007 database
- From: "Benedictum" <dominus@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 16:35:33 -0500
check this out: http://www.connectionstrings.com/?carrier=access2007
"Andy" <andy@xxxxxxxxx> wrote in message
news:47271e04$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Mike,
Thanks for responding and the code snippet. I tried it using the following
for SProvider1:
SProvider1 := 'Provider=Microsoft.ACE.OLEDB.12.0;Persist Security
Info=False;Jet OLEDB:Database Password=ppp;Jet OLEDB:New Database
Password=ppp;Data Source=' ;
But it gives me the following errors:
'Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.'
Any idea where I went wrong?
Thanks again.
Andy
"MikeR" <nf4lNoSpam@xxxxxxxxx> wrote in message
news:47270ee2@xxxxxxxxxxxxxxxxxxxxxxxxx
Andy wrote:
What component should I get to compact and repair Access 2007 databases.Import the type library from msjro.dll
I used to use Adonis JRO to do this but it does not support .accdb 2007
files.
Thanks in advance.
Andy
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
.
- References:
- Compact/Repair Access 2007 database
- From: Andy
- Re: Compact/Repair Access 2007 database
- From: MikeR
- Re: Compact/Repair Access 2007 database
- From: Andy
- Compact/Repair Access 2007 database
- Prev by Date: Re: Traffic a little slow in this NG ?
- Next by Date: Re: Traffic a little slow in this NG ?
- Previous by thread: Re: Compact/Repair Access 2007 database
- Next by thread: Re: Compact/Repair Access 2007 database
- Index(es):
Relevant Pages
|
|