#include <stdio.h>
#include "sql.h"

/*----------------------------------------------------------------*/
/*  Example of simple connect                                     */
/*----------------------------------------------------------------*/

int main( void ) {

SQLTCUR cur;                            /* SQLBASE cursor number  */
SQLTRCD rcd;                            /* return code */

  /*
  ** CONNECT TO THE DATABASE
  */

  if (rcd = sqlcnc(&cur, "SQLBASE", 0, NULL)) {
    printf("FAILURE ON CONNECT %d\n",rcd);
    exit(1);
  }
  else
    printf("Connection Established\n");

  /*
  ** DISCONNECT FROM THE DATABASE
  */

  if (rcd = sqldis(cur))
    printf("FAILURE ON DISCONNECT %d\n",rcd);
  else
    printf("Disconnect Performed\n");

  return( 0 );
}
