Previous Topic

Next Topic

Done

When an application and/or process has completed operations with the database, it must release resources by disconnecting from the database engine.

Below is the code for Done():

/********************************************************
*                                                       *
* db_close:      close the data files and indices.       *
*                                                       *
********************************************************/
#ifdef PROTOTYPE
VOID db_close(void)
#else
VOID db_close()
#endif
{

	if (CloseCtFile(INVENTDAT,0))	/* the second parameter is no longer used*/
		func_error(INVENTDAT);
	if (CloseCtFile(INVENTIDX,0))
		func_error(INVENTIDX);
		
	StopUser();	/* Terminate this user with server and/or free-up
			 * c-tree PLUS(tm) memory allocations.
			 * You can include this even if you are
			 * not sure if you will be using the server.
			 */
	ctrt_exit(0);
}