Board index » delphi » Saving Modified Net Dir at Run-Time

Saving Modified Net Dir at Run-Time

I'm stomped.  I can't seem to save the Net Dir settings permanently.  Here's
the little piece of cold I use:

procedure UpdateNetDir;
begin
  with TSession.Create(Self) do
  try
    SessionName := 'UpdateIDAPIsession';
    Active := TRUE;
    ConfigMode := cmAll;
    NetFileDir := 'C:\TEMP';
    SaveConfigFile;
    Active := FALSE;
  finally
    Free;
  end;
end;

After calling this function and terminating all running apps utilising the
BDE; I checked the BDE Administrator and the NET DIR setting is still the
old path.  It hasn't change to "C:\TEMP".  I've also try using DbiSetProp.
That didn't go well for me either.  If someone can help, please do so.
Also, provide a sample code.  That would help me alot.  Thanks...

 

Re:Saving Modified Net Dir at Run-Time


Try here:
http://www.borland.com/devsupport/bde/bdeapiex/dbiopencfginfolist.html
Use carefully.

Regards,
Chris Roberts

Re:Saving Modified Net Dir at Run-Time


You need to suce the BDE API function DbiOpenCfgInfoList. See the examples
at www.borland.com/bde/bdeapiex.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Re:Saving Modified Net Dir at Run-Time


Thanks for the tip.  I tried testing the GetConfigParameter and
SetConfigParameter functions passing the PARADOXNETDIR parameter to see if I
can get the NET DIR directory.  However, I kept getting this error "An error
occurred while attempting to initialize the Borland Database Engine (error
$2A06)".  The error occurred when executing the DbiOpenCfgInfoList function.
What could be wrong?

Environment I'm testing this on:
  Win98 SE
  Delphi 5
  BDE version 5.01

Since I can't get pass the DbiOpenCfgInfoList function, I can't retrieve any
values at all.  I could use as much help as possible.  Thanks

Quote
Chris Roberts <cdroberts_nos...@bigpond.com> wrote in message

news:0otcassup5oq57q5mp6sukicsjqhdnkrt6@4ax.com...
Quote
> Try here:
> http://www.borland.com/devsupport/bde/bdeapiex/dbiopencfginfolist.html
> Use carefully.

> Regards,
> Chris Roberts

Re:Saving Modified Net Dir at Run-Time


Hi Bill,

I still need more help.  I've also reply to Chris Roberts message just in
case you or Chris don't happen to read each other's mesage.

Thanks for the tip.  I tried testing the GetConfigParameter and
SetConfigParameter functions passing the PARADOXNETDIR parameter to see if I
can get the NET DIR directory.  However, I kept getting this error "An error
occurred while attempting to initialize the Borland Database Engine (error
$2A06)".  The error occurred when executing the DbiOpenCfgInfoList function.
What could be wrong?

Environment I'm testing this on:
  Win98 SE
  Delphi 5
  BDE version 5.01

Since I can't get pass the DbiOpenCfgInfoList function, I can't retrieve any
values at all.  I could use as much help as possible.  Thanks

Bill Todd (TeamB) <b...@dbginc.com> wrote in message
news:887jug$hb46@bornews.borland.com...

Quote
> You need to suce the BDE API function DbiOpenCfgInfoList. See the examples
> at www.borland.com/bde/bdeapiex.

> --
> Bill

> Bill Todd (TeamB)
> (TeamB cannot respond to questions received via email)

Re:Saving Modified Net Dir at Run-Time


On Sun, 13 Feb 2000 19:33:10 -0600, "Bee Vang" <beeya...@yahoo.com>
wrote:

Quote
>Thanks for the tip.  I tried testing the GetConfigParameter and
>SetConfigParameter functions passing the PARADOXNETDIR parameter to see if I
>can get the NET DIR directory.  However, I kept getting this error "An error
>occurred while attempting to initialize the Borland Database Engine (error
>$2A06)".  The error occurred when executing the DbiOpenCfgInfoList function.
>What could be wrong?

When you haven't used any DB components yet in your application, the
BDE is not initialized yet.

Call this in the beginning of your code:
  Check(DbiInit(nil));

HTH,

Jan

Re:Saving Modified Net Dir at Run-Time


You need to initialize the BDE by calling Check(DbiInit(nil)) if your
default BDE session has not been initialized and in this case it has not.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads