Board index » delphi » Setting MAXFILEHANDLES at runtime

Setting MAXFILEHANDLES at runtime

My 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?
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


My 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?
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


On Fri, 25 Aug 2000 15:54:42 -0700, "Lauretta Carroll"

Quote
<carr...@legacypress.com> wrote:
>How can I get the app to recognize that the MAXFILEHANDLES
>has been increased at runtime, upon initial entry?

You need to run the code *before* opening any of the BDE-related
objects like TDataset, TDatabase and TSession.  When you place the
code in the initialization section of your main form, it will execute
before the BDE is connected to and it should take immediate effect on
the condition that you don't have another BDE application running.

Quote
>Is there someplace else I can put the
>SetConfigParameter call? Is there someway to "refresh" the
>MAXFILEHANDLE at runtime?

No.  Changed settings are only effective after all BDE applications
have been closed.

Jan

Other Threads