Board index » delphi » BDE Error $2A06 - Engine Not Initialized Huh?

BDE Error $2A06 - Engine Not Initialized Huh?

I am having a strange problem with BDE v5.01 (Delphi v3.02, 96MB RAM, P2@233mhz,
NT4 Server SP3, twisted pair). At least, it's a new one to me. It has to do with
BDE initialization and Paradox tables.

If, while in the IDE, I toggle all TTable's active property to true I can test
my app. It runs okay however the BDE doesn't recognize a secondary index I'm
trying to set programmatically. The BDE tells me the secondary index doesn't
exist. (The index was generated using native PFW7 -- it exists. I've rebuilt it
several times w/o any luck).

Note that all table's active property is set to false on start up. I set active
to true programmatically.

However, if, while in the IDE, I toggle all TTable's active property to false
then I receive Error $2A06 - Engine Not Initialized  - when I run the program.
The BDE is isn't initialized.

What am I missing here? <sigh>

Thanks in advance,

-- Ty

 

Re:BDE Error $2A06 - Engine Not Initialized Huh?


You should go to developers.href.com

There, you can enter 2A06 as your search clue, and you will see messages
like this:

Error $2A06 is "Engine not initialized" which means that you did not
call DbiInit.

If you want a simpler solution drop a TDatabase and a TTable on a form
and use the following.

function dgPackParadoxTable(Tbl: TTable; Db: TDatabase):DBIResult;
{Packs a Paradox table by calling the BDE
DbiDoRestruct function. The TTable passed as the
first parameter must be closed. The TDatabase passed
 as the second parameter must be connected.}
var
  TblDesc: CRTblDesc;
begin
Result := DBIERR_NA;
FillChar(TblDesc, SizeOf(CRTblDesc), 0);
StrPCopy(TblDesc.szTblName, Tbl.TableName);
TblDesc.bPack := True;
Result := DbiDoRestructure(Db.Handle, 1, @TblDesc, nil, nil, nil,False);
end;

Since you mentioned that you are "setting" and index programatically,
maybe you are using BDE functions and forgot to do the DbiInit?

mIKE

Re:BDE Error $2A06 - Engine Not Initialized Huh?


In article <36D77E8B.6...@flash.net>, verha...@flash.net says...

Quote
> You should go to developers.href.com

> There, you can enter 2A06 as your search clue, and you will see messages
> like this:

> Error $2A06 is "Engine not initialized" which means that you did not
> call DbiInit.

> If you want a simpler solution drop a TDatabase and a TTable on a form
> and use the following.

> function dgPackParadoxTable(Tbl: TTable; Db: TDatabase):DBIResult;
> {Packs a Paradox table by calling the BDE
> DbiDoRestruct function. The TTable passed as the
> first parameter must be closed. The TDatabase passed
>  as the second parameter must be connected.}
> var
>   TblDesc: CRTblDesc;
> begin
> Result := DBIERR_NA;
> FillChar(TblDesc, SizeOf(CRTblDesc), 0);
> StrPCopy(TblDesc.szTblName, Tbl.TableName);
> TblDesc.bPack := True;
> Result := DbiDoRestructure(Db.Handle, 1, @TblDesc, nil, nil, nil,False);
> end;

> Since you mentioned that you are "setting" and index programatically,
> maybe you are using BDE functions and forgot to do the DbiInit?

> mIKE

Mike,

Thanks for the response.

Regarding developers.href.com, I've been there. I have also downloaded and
currently use the BDE Error lookup app on Borland's BDE web site. It's a pretty
handy tool. You might want to take a look at it. It's a small file making
downloading a snap. Now, regarding the DBE...

What surprises me is that while in design I can view the table's contents in a
dbgrid if the TTable's active property is set to true and also run the app w/o
any problems. If, on the other hand, I set the active property to false and then
run the app I receive the engine init error.

1. Isn't the BDE initialized while in design if I set the TTable's active
property to true? Am I missing something critical here?

2. Do you know where I can find out what Registry settings the BDE uses? Delphi,
BDE, etc have all been installed to the installation default directories. I'd
like to compare my setup to some norm.

And, no, I am not using BDE API directly to set the index. I'll give it another
look to see what I missed. My intuition tells me that I'm probably not seeing
the tree because the forest is getting in the way <g>.

Anyway, looking forward to hearing back from you.

Regards,

-- Ty

Re:BDE Error $2A06 - Engine Not Initialized Huh?


The BDE should be initialized automatically. Are you using a TDatabase
component?  If not, try dropping on on your main form and see if that makes
a difference.

Bill

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:BDE Error $2A06 - Engine Not Initialized Huh?


Ty:

For starters, take Bill's suggestion of putting a TDatabase on your main
form.  I'm not sure what all that accomplishes, or how it does it, but I
have found that some things just don't work as expected until I do
that.  Since you don't start a new app every day, it's easy to forget
some of the things you did the last time you created a new app.

Quote
> 1. Isn't the BDE initialized while in design if I set the TTable's
> active property to true? Am I missing something critical here?
> 2. Do you know where I can find out what Registry settings the BDE
> uses? Delphi, BDE, etc have all been installed to the
> installation default directories.
> I'd like to compare my setup to some norm.

I can't help much in this area, mostly because the BDE really hasn't
caused me enough problems to force us to learn about that stuff.

mIKE

Other Threads