Searching on MSDN I found Ihad to use 0x80040112 and it found a whole 4 articles.

One mentioned:

NOTE: If an error occurs when registering a control, you should do the following: 
1. Verify in the Registry that the control has not been registered before. 
2. Verify that the following files are in the Windows\System directory: 
      mfc30.dll     olepro32.dll     msvcrt20.dll
      mfc40.dll     msvcrt40.dll

   If one of these files is missing, you may receive the following error
   Message:

      Error: OLE Error Code 0x80040112: Appropriate license for this
      class not found.


I have replicated the fault here on a Win98 Machine. The files listed above are all 
installed. I am not sure if they are registered, or if they have to be, but I will try 
that next.

other than that I suppose I will have to use another method to add the field to the 
database.

The code I am using is:

procedure TForm1.CreateNewFieldsClick(Sender: TObject);
Const
  dbBoolean                     =  1; // Yes/No
Var
  DBName, TableDef, FieldDef : Variant;
 Engine          : DBEngine;
 DB               : Database;
 Size,
 v : OLEVariant;
begin
  // Add a field to the database
 Engine := CoDBEngine.Create; //Init DaoEngine
 if (Engine <> nil) then
   begin
      DB := Engine.OpenDatabase(ReturnDatabasePath(CallCentralDatabaseName), 0, False, 
';PWD='+ReturnDatabasePassword); //Database Open
      if (DB <> NIL) then
          begin
              TableDef  := DB.TableDefs['Adrock_Report'];
              size := 0;
              FieldDef := TableDef.CreateField('IncludeIncomingCalls', dbBoolean, 
size);
              try
                TableDef.Fields.Append( FieldDef );
                Halt(1);
              except
                 // Do Nothing
                 Halt(0);
              end;
         end;
   end;
end;


Christopher Crowe (Software Developer)
Microsoft MVP, MCP

Adrock Software
Byte Computer & Software LTD
P.O Box 13-155 
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112

 -----Original Message-----
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]  On Behalf Of Myles 
Penlington
Sent:   Wednesday, 2 June 1999 11:23
To:     '[EMAIL PROTECTED]'
Subject:        RE: [DUG]:  OLE ERROR - urgent

Pass on the error - But do they have the right version of access installed that 
supports this call?, or it (access) may need re-installing if the app works okay on 
other machines.

You could try searching for "40112" in the delphi library. I would suspect it is an 
Access error, not just a straight COM error.

Join the crowd - I've never had luck in matching a HResult to an actual Error Code - 
Always seems to get errors that are not supposed to be returned by the CO/COM 
functions.
Myles.

-----Original Message-----
From:   Chris Crowe [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, June 02, 1999 10:49 AM
To:     Multiple recipients of list Delphi
Subject:        [DUG]:  OLE ERROR - urgent

I have a person who is using a small app which I wrote to add a field to a Access.MDB 
and gets the following error:

Exception EOleSysError in module ADDFIELDTODB.EXE at 0008BC75
OLE error 80040112

Does anyone know what the OLE Error is? I could not find it in my MSDN Library.

It is happening at this point:

 Engine := CoDBEngine.Create; //Init DaoEngine

Chris

Christopher Crowe (Software Developer)
Microsoft MVP, MCP

Adrock Software
Byte Computer & Software LTD
P.O Box 13-155 
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112

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

winmail.dat

Reply via email to