dbinit

DB Library for C

DB Library for C

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 Microsoft® Windows® 2000 or in the Microsoft Windows NT® 4.0 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 4.0 operating system, you set the date, time, numeric, and currency formatting using the International application in the Control Panel.

Under Microsoft 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. For DB-Library to release this information, the application must call dbwinexit just before it exits.

See Also

dbconvert

dbwinexit (Windows only)