Not enough Parameters?
From: jason (jason_at_noreplies.com)
Date: 02/24/05
- Next message: kei: "How to clone a TADOQuery"
- Previous message: Kjell Rilbe: "Re: ADO + CoInitialize in threads? Mystery..."
- Next in thread: Brian Bushay TeamB: "Re: Not enough Parameters?"
- Reply: Brian Bushay TeamB: "Re: Not enough Parameters?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Feb 2005 00:08:16 -0800
Hi all,
I have written the following function to compact & repair my
MS Access database.
My problem is that I keep getting the following exception on the
V.CompactDatabase line saying "project blah.exe raised exception class EOleSysError with message 'Invalide number of parameters'"
Hope you can shed some light on this. The function is below:
Many thanks, Jason.
==========================
function TfrmMaintenance.CompactAndRepair(DB: string): Boolean; {DB = Path to Access Database}
var
v: OLEvariant;
begin
Result := True;
try
v := CreateOLEObject('JRO.JetEngine');
try
V.CompactDatabase('Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DB+';Mode=Share Deny None;Persist Security Info=false;Jet OLEDB:Database Password=xxxxxxx' +
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DB+'x;Mode=Share Deny None;Persist Security Info=false;Jet OLEDB:Database Password=xxxxxxx');
frmMaintenance.lbStatus.Caption := 'Finished repairing database.';
Application.ProcessMessages;
// DeleteFile(DB);
// RenameFile(DB+'x',DB);
finally
V := Unassigned;
end;
except
Result := False;
end;
end;
- Next message: kei: "How to clone a TADOQuery"
- Previous message: Kjell Rilbe: "Re: ADO + CoInitialize in threads? Mystery..."
- Next in thread: Brian Bushay TeamB: "Re: Not enough Parameters?"
- Reply: Brian Bushay TeamB: "Re: Not enough Parameters?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|