/****************************************************************************/ // SQLSVR.H v1.0 - 24 10 1990 /****************************************************************************/ /* */ /* Copyright (c) 1989-1993 Bernhard Strassl */ /* Institute for Applied Computer Science and Information Systems */ /* University of Vienna, Austria */ /* */ /* See file COPYRIGHT in this directory for details. If this file is */ /* missing please mail to bernhard@ani.univie.ac.at */ /****************************************************************************/ #ifndef _CB_SQLSVR_INCLUDED #define _CB_SQLSVR_INCLUDED 1 // SqlServer - generic interface to a SQL Server #include // system independend definitions class CursorInfo; // system independend info about a database cursor class QryDescr; // an object containing column infos class BindDescr; // an object containing pgm var infos class SqlSvr { friend class SqlMgr; friend class SqlObjectMgr; friend testSvr(); CursorInfo** cursors; SqlSvr(); // init database access ~SqlSvr(); // terminate database access CursorInfo* connect(char*, // database/user/passwd int = SS_DEFAULT, // max cursor size short = SS_DEFAULT, // sql input buffer short = SS_DEFAULT); // sql output buffer bool disconnect(CursorInfo*); bool compile(CursorInfo*, char*); // compile a SQL statement bool exec(CursorInfo*); // execute current statement bool compexec(CursorInfo*, char*); // compile and execute bool bindInput(CursorInfo*, BindDescr*); // bind pgm variables to SQL bool bindOutput(CursorInfo*, BindDescr*); // bind receive buffers bool descr(CursorInfo*, QryDescr&); // fill in a row descriptor bool fetch(CursorInfo*, short&); // fetch next row bool getStatus(CursorInfo*, int&); // get current cursor status bool getRbFlag(CursorInfo*, bool&); // get rollback flag bool getRowCount(CursorInfo*, char*, long&); // count rows in a table bool getCurRowCount(CursorInfo*, long&); // rows retrieved by last qry bool commit(CursorInfo*); bool rollback(CursorInfo*); void error(CursorInfo*); // default error function bool getErrorText(CursorInfo*, char*); // copy text for current // cursor status into buffer }; #endif