Thanks
Technical Information DatabaseTI230B.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). Thismethod is not reccommended because
only one configuration filecan be used for all BDE applications.
>I found the following doc that discusses changing the Net Dir. D5 does not
>seem to reconize some of the commands and I can not find them in the hlp
>files either. I assume it is either BCPP or just old. Does anyone have
>info for D5.
[...]
In Delphi 5, do what you ask by setting the TSession.NetFileDir property to
the drive and directory. Do this in a handler for the OnCreate event of the
application's main form.
Session.NetFileDir := ExtractFilePath(Application.EXEName) +
'Data\';
The functions you could not find information on are BDE API functions.
These are identified by the "Dbi" prefix. To use these functions in a
Delphi application, you must include the BDE wrapper unit named "BDE" in
your unit's Uses section. Help for these functions is in the BDE online
help, BDE32.HLP, found in the main BDE directory.
==========================================================================
Steve Koterski "Computers are useless. They can only give
Technical Publications you answers."
Borland -- Pablo Picasso (1881-1973)
http://www.borland.com/techpubs/delphi