dbinit

Initializes DB-Library.

Syntax

LPCSTR dbinit ( void );

Returns

A null-terminated string containing the version of DB-Library, or null if initialization is unsuccessful.

Remarks

The application should call dbinit once and only once, before calling any other DB-Library functions.

The dbinit function enables dbconvert to use the international settings specified in SQLCOMMN.LOC for Windows or in the Windows NT Registry.

For the Windows operating system, DB-Library retrieves information about date, time, numeric, and currency formatting from the SQLCOMMN.LOC file. The location of SQLCOMMN.LOC is pointed to by the SQLLocalizationFile key in the Windows initialization file (WIN.INI) under the [SQLSERVER] application heading. For example:

[SQLSERVER]
SQLLocalizationFile=C:\SQL60\BIN\SQLCOMMN.LOC

For the Windows NT operating system, you set the date, time, numeric, and currency formatting using the International application in the Control Panel.

Under MS-DOS, dbinit detects the presence of the Net-Library TSR used by DB-Library to communicate over the network. If the TSR is not detected, dbinit returns null and DB-Library functions cannot be used. When running with the Windows environment, DB-Library maintains information about each application that has referenced it. DB-Library creates the information when a library application calls dbinit; it does this to prevent conflicts between applications that use DB-Library concurrently. In order for DB-Library to release this information, the application must call dbwinexit just before it exits.

See Also

dbconvert, dbwinexit