community.borland.com

Article #15230: Changing the NET DIR Programmatically

 Technical Information Database

TI230B.txt   Changing the NET DIR Programmatically
Category   :General Programming
Platform    :All
Product    :BDE  All

Description:
General: 
The "NET DIR" parameter for the Paradox driver is usually 
indicated in the BDE Configuration Utility on the drivers 
tab.  The NET DIR indicates where the PDOXUSRS.NET file is 
located. If the NET DIR is pointing to a location not 
containing a PDOXUSRS.NET file, one will be created there.

Changing the NET DIR programmatically:
It is possible to change where the NET DIR is pointing 
programmatically by using the DbiSetProp() function, but 
first, a handle to the BDE session must be acquired. The 
session handle can be acquired through DbiGetCurrSession(). 
Here is how one could change the NET DIR:

void main(void)
{
     hDBISes hSes;
     
     DbiInit(NULL);
     DbiGetCurrSession(&hSes);
     DbiSetProp(hSes, sesNETFILE, (UINT32)"c:\\temp");
     Dbi...
     ...
}

Notes:
The sesNETFILE constant is an Object Property and a clearer 
definition can be found by searching for "Object Property" in 
the BDE On-Line help.  Another way to change the default 
NET DIR is to pass DbiInit() a DBIEnv structure that specifies 
a different .cfg (configuration) file other than the default 
IDAPI.CFG (calling DbiInit(NULL) will use IDAPI.CFG).  This
method is not reccommended because only one configuration file
can be used for all BDE applications.

Reference:


7/15/98 3:24:23 PM
 

Last Modified: 01-SEP-99