> I am getting a 216 error (In a large app) and a 217 (go figure) in a small
> app that I created (see below for code). The error is occuring when I create
> a TADOQuery in the initialization section of a unit. Has anybody got any
> ideas, pointers etc??

Doesn't ADO use the Ole subsystem... if so then ttrying to use Ole
in the Initialization fails because the Application.Initialize hasn't been called
yet to start the subsystem... Write an initialisation procedure in the unit and
call the procedure after application.initialize in the DPR.

I'd suggest

Unit Unit1;

interface
uses
   ADOdb;

  procedure InitializeQuery;

var
  Q :TADOQuery;

implementation
uses
  SysUtils;

procedure InitializeQuery;
begin
  Q := TADOQuery.Create(nil);
end;

finalization
  Q.Free; // No need to nil it at the end of the application...
end.

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax




---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to