OdbcWrapper.h File Reference

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

Classes

struct  OdbcControlStruct

Typedefs

typedef OdbcControlStructOdbcHandle

Functions

OdbcHandle odbcConnect (const char *dbname, const char *servername, const char *username, const char *driver, const char *password=NULL)
 Tries to establish DSN-less connection to the database.
bool odbcDisconnect (OdbcHandle &handle)
 Disconnects from data source and frees all resources.
bool odbcExecute (const OdbcHandle handle, const char *sqlStatement)
 Executes an SQL statement.
int odbcResultColumns (const OdbcHandle handle)
 Returns the number of columns in a result set.
bool odbcGetNextRow (const OdbcHandle handle)
 Moves to the next row in the result set, reset by new result set.
bool odbcGetColumnStringData (const OdbcHandle handle, int columnIndex, char *data, int dataSize)
 Returns column string data from current row.
bool odbcClearResultSet (const OdbcHandle handle)


Typedef Documentation


Function Documentation

OdbcHandle odbcConnect ( const char *  dbname,
const char *  servername,
const char *  username,
const char *  driver,
const char *  password = NULL 
)

Tries to establish DSN-less connection to the database.

Parameters:
dbname (in) - name of the data source
servername (in) - server name
username (in) - name of the user
password (in) - password to connect to data source
driver (in) - driver name used to connect
Returns:
a handle representing the connection

bool odbcDisconnect ( OdbcHandle handle  ) 

Disconnects from data source and frees all resources.

Parameters:
handle (in) - handle returned by odbcConnect
Returns:
true if disconnected sucessfully, otherwise false

bool odbcExecute ( const OdbcHandle  handle,
const char *  sqlStatement 
)

Executes an SQL statement.

Parameters:
handle (in) - handle returned by odbcConnect
sqlStatement (in) - pointer to string containing the SQL statement
Returns:
true if connected to data source otherwise false

int odbcResultColumns ( const OdbcHandle  handle  ) 

Returns the number of columns in a result set.

Parameters:
handle (in) - handle returned by odbcConnect
Returns:
number of columns in result set

bool odbcGetNextRow ( const OdbcHandle  handle  ) 

Moves to the next row in the result set, reset by new result set.

Parameters:
handle (in) - handle returned by odbcConnect
Returns:
true while there is a next row to move to

bool odbcGetColumnStringData ( const OdbcHandle  handle,
int  columnIndex,
char *  data,
int  dataSize 
)

Returns column string data from current row.

Parameters:
handle (in) - handle returned by odbcConnect
columnIndex (in) - column index in row
data (out) - data buffer to receive string data
dataSize (in) - size of buffer
Returns:
true while there is a next row to move to

bool odbcClearResultSet ( const OdbcHandle  handle  ) 

Parameters:
handle (in) - handle returned by odbcConnect
Returns:
true if result set could be cleared


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:13:23 build16 abuild