Not enough Parameters?

From: jason (jason_at_noreplies.com)
Date: 02/24/05


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;



Relevant Pages

  • Windows Explorer Crashes
    ... delete a file or right click a file in Windows Explorer it ... crashes with an Application Exception message. ... I tried doing a Windows Repair booting from Win2000 Setup ... floppies and using an up-to-date Repair disk but the repair ...
    (microsoft.public.win2000.applications)
  • Re: Aircraft tax question
    ... > sold it for $50,000, I would be liable for taxes $45,000? ... An exception to the rules about capital vs. repair is ...
    (rec.aviation.owning)
  • RunDLL hotplug.dll
    ... When I stop the USB port I get an exception containing RunDLL hotplug.dll. ... Should I reinstall or repair the file? ...
    (microsoft.public.windowsxp.help_and_support)
  • AWG2020 or AWG2021 Help
    ... With the exception of the A3, ... parts in duplicate and working and I am willing to share. ... colaborate w/ repair? ...
    (sci.electronics.equipment)
  • Re: writeXML(fullFilePath) DOESNT Write
    ... I also wonder if you get an exception on attempt to load saved file... ... > The following hardware and drivers are not supported in the Emulator: ... > File system drivers, which include file allocation table, compact ... XML into the dataset from the path noted in the code I've provided (using ...
    (microsoft.public.dotnet.framework.compactframework)