Step 4: Set the directory for temporary objects

<< Click to Display Table of Contents >>

Navigation:  Application development > Introduction to BDE programming > BDE Programming in C++Builder > Basic procedure >

Step 4: Set the directory for temporary objects

Previous pageReturn to chapter overviewNext page

After pointing the database to a directory containing data objects, use the DbiSetPrivateDir to designate a directory as the container for temporary files for the client.

Not all BDE applications create temporary objects, but larger applications do sometimes create them. For example, the result set from a query of the records that cause a key violation in a restructure will be placed in a temporary table. By default, this temporary, or "private" directory, is the startup directory. This will cause a problem if the application is running on a network (because the directory cannot be shared) or a CD-ROM (because the application cannot write to the directory).

Here, the Temp folder on the C: drive is used.

Check(DbiSetPrivateDir("c:\\Temp"))

 

Note:        You must use the full, absolute path. Relative paths are not supported.