Previous Topic

Next Topic

Init

First we need to open a connection to a database by providing the c-treeACE Database Engine with a user name, password and the database name.

Below is the code for Initialize():

/*
 * Initialize()
 *
 * Perform the minimum requirement of logging onto the c-tree Server
 */

#ifdef PROTOTYPE
VOID Initialize(VOID)
#else
VOID Initialize()
#endif
{
#ifdef ctThrds
   NINT  retval;
#endif

   printf("INIT\n");

#ifdef ctThrds
   /* initialize c-tree multi-thread environment */
   if ((retval = ctThrdInit(3, 0L, NULL)) != 0)
      Handle_Error("Initialize(): ctThrdInit()", retval);
#endif

   /* initialize c-tree Plus and log on to c-tree Server */
   printf("\tLogon to server...\n");
   if (InitISAMXtd(16, 16, 16, 16, 0, "", "", "FAIRCOMS"))
      Handle_Error("Initialize(): InitISAMXtd()", 0);
}