Board index » delphi » Setting MAXFILEHANDLES at runtime

Setting MAXFILEHANDLES at runtime

My D5 application prompts the following error message upon entry:
"EDBEngineError Too many open files. You may need
to increase MAXFILEHANDLE limit in IDAPI configuration".

OK.On the OnCreate event for form1, I put the following:
SetConfigParameter(MAXFILEHANDLES, '400');
where SetConfigParameter comes straight form the
BDE API Examples (DbiOpenCfgInfoList).

When I exit my application, and check the bdeadmin,
the maxfileshandle has been correctly set. And, subsequent
entries into my app are fine, too. The problem is this:

How can I get the app to recognize that the MAXFILEHANDLES
has been increased at runtime, upon initial entry such that it does not give
an error message?
Is there someplace else I can put the
SetConfigParameter call? Is there someway to "refresh" the
MAXFILEHANDLE at runtime?
Please help.
Thanks
Lauretta

 

Re:Setting MAXFILEHANDLES at runtime


I had the same problem some time ago.  If I remember correctly, once your
app increases the MAXFILEHANDLES it is saved in one of the BDE configuration
files.   I believe you have to reboot before the changes are accepted,
unless the BDE has not already been initialized - I think.  MAXFILEHANDLES
should be OK from this point on, unless another app resets it.  Each
workstation must go through this process.  So... in theory the problem
should only exist the first time your app is run, and as long as each
workstation has been rebooted at least once (after running the app) then
things should be OK.

I run my SetMAXFILEHANDLES procedure in the project source file.  This way
it runs before my app is initialized.

Tom

Quote
"Lauretta Carroll" <carr...@legacypress.com> wrote in message

news:39a6e992_2@dnews...
Quote
> My D5 application prompts the following error message upon entry:
> "EDBEngineError Too many open files. You may need
> to increase MAXFILEHANDLE limit in IDAPI configuration".

> OK.On the OnCreate event for form1, I put the following:
> SetConfigParameter(MAXFILEHANDLES, '400');
> where SetConfigParameter comes straight form the
> BDE API Examples (DbiOpenCfgInfoList).

> When I exit my application, and check the bdeadmin,
> the maxfileshandle has been correctly set. And, subsequent
> entries into my app are fine, too. The problem is this:

> How can I get the app to recognize that the MAXFILEHANDLES
> has been increased at runtime, upon initial entry such that it does not
give
> an error message?
> Is there someplace else I can put the
> SetConfigParameter call? Is there someway to "refresh" the
> MAXFILEHANDLE at runtime?
> Please help.
> Thanks
> Lauretta

Other Threads