Specifying Paradox Directory Locations

From RAD Studio
Jump to: navigation, search

Go Up to Managing database sessions Index

Attention: The Borland Database Engine (BDE) has been deprecated, so it will not be enhanced. For instance, BDE will never have Unicode support. You should not undertake new development with BDE. Consider migrating your existing database applications from BDE to dbExpress.

Two session component properties, NetFileDir and PrivateDir, are specific to applications that work with Paradox tables.

NetFileDir specifies the directory that contains the Paradox network control file, PDOXUSRS.NET. This file governs sharing of Paradox tables on network drives. All applications that need to share Paradox tables must specify the same directory for the network control file (typically a directory on a network file server). Delphi derives a value for NetFileDir from the Borland Database Engine (BDE) configuration file for a given database alias. If you set NetFileDir yourself, the value you supply overrides the BDE configuration setting, so be sure to validate the new value.

At design time, you can specify a value for NetFileDir in the Object Inspector. You can also set or change NetFileDir in code at run time. The following code sets NetFileDir for the default session to the location of the directory from which your application runs:

Session.NetFileDir := ExtractFilePath(Application.EXEName);
Session->NetFileDir = ExtractFilePath(ParamStr(0));
Note: NetFileDir can only be changed when an application does not have any open Paradox files. If you change NetFileDir at run time, verify that it points to a valid network directory that is shared by your network users.

PrivateDir specifies the directory for storing temporary table processing files, such as those generated by the BDE to handle local SQL statements. If no value is specified for the PrivateDir property, the BDE automatically uses the current directory at the time it is initialized. If your application runs directly from a network file server, you can improve application performance at run time by setting PrivateDir to a user's local hard drive before opening the database.

Note: Do not set PrivateDir at design time and then open the session in the IDE. Doing so generates a Directory is busy error when running your application from the IDE.

The following code changes the setting of the default session's PrivateDir property to a user's C:\TEMP directory:

Session.PrivateDir := "C:\TEMP";
Session->PrivateDir = "C:\\TEMP";
Warning: Do not set PrivateDir to a root directory on a drive. Always specify a subdirectory.

See Also