Use a particular database.
RETCODE dbuse(dbproc, dbname) DBPROCESS *dbproc; char *dbname;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
The name of the database to use.
SUCCEED or FAIL.
This routine issues a Transact-SQL use command for the specified database for a particular DBPROCESS. It sets up the command and calls dbsqlexec and dbresults.
If the use command fails because the requested database has not yet completed a recovery process, dbuse will continue to send use commands at one second intervals until it either succeeds or encounters some other error.
The routine uses the dbproc provided by the caller. It also uses the command buffer of that dbproc. dbuse overwrites any existing commands in the buffer and clears the buffer when it is finished.