|        | |||||
|  | |||||
| Migrating from OMODBC 1.0 to OMODBC 2.0 | |||||
| ------ | 
The OMODBC 2.0 library extends the existing library by adding all the new functionality that was introduced in ODBC 3.0. The next biggest change between the OMODBC versions 1.0 and 2.0 is the introduction of opaque variables into the OmniMark language. The OMODBC 2.0 library defines three opaque data types that are used in the ODBC functions. These new opaque types are:
The SQL_Handle_type replaces the counter-type variables used in version 1.0 to represent environment, connection and statement handles. Usage of the opaque data type allows for better type-checking in calls to the OMODBC functions.
The SQL_Array_type and SQL_Vector_type replace the MemoryBlock counters used in version 1.0. These opaque data types allow better function type-checking and reduce memory access violations and leaks.
The following functions are no longer available in the OMODBC library.
The list of replacement functions is also presented.
  OBSOLETE FUNCTION                ALTERNATE
  ----------------------------     --------------------------
  HSQLAllocMemoryBlock             SQLSetArraySize
                                   SQLSetVectorSize
  HSQLCopyCounterToMemoryBlock     SQLSetArrayAsCounter
                                   SQLSetArrayAsCounterShelf
                                   SQLSetVectorAsCounter
  HSQLCopyMemoryBlockToCounter     SQLGetArrayAsCounter
                                   SQLGetArrayAsCounterShelf
                                   SQLGetVectorAsCounter
  HSQLCopyStreamToMemoryBlock      SQLSetArrayAsStream
                                   SQLSetArrayAsStreamShelf
                                   SQLSetArrayAsString
                                   SQLSetVectorAsStream
                                   SQLSetVectorAsString
  HSQLCopyMemoryBlockToStream      SQLGetArrayAsStream
                                   SQLGetArrayAsStreamShelf
                                   SQLGetArrayAsString
                                   SQLGetVectorAsStream
                                   SQLGetVectorAsString
  HSQLFreeMemoryBlock              none
The introduction of the opaque types into the OmniMark language and
OMODBC library has resulted in data type changes in the OMODBC
functions. In general, these changes can be summarized in the 
following table:
VERSION 1.0 DATA TYPE VERSION 2.0 DATA TYPE --------------------- --------------------- counter (henv) SQL_Handle_type counter (hdbc) SQL_Handle_type counter (hstmt) SQL_Handle_type counter (MemoryBlock) SQL_Array_type or SQL_Vector_type
The following table presents the list of all the OMODBC 1.0 functions
and all affected arguments.
  FUNCTION             VER 1.0 TYPE   VER 1.0 ARG VER 2.0 TYPE
  --------             ------------   ----------- ------------
  SQLAllocConnect      counter        henv        SQL_Handle_type
                       counter        hdbc        SQL_Handle_type
  SQLAllocEnv          counter        henv        SQL_Handle_type
  SQLAllocStmt         counter        hdbc        SQL_Handle_type
                       counter        hstmt       SQL_Handle_type
  SQLBindCol           counter        hstmt       SQL_Handle_type
                       counter        rgbValue    SQL_Array_type
                       counter        pcbValue    SQL_Array_type
  SQLBindParameter     counter        hstmt       SQL_Handle_type
                       counter        rgbValue    SQL_Array_type
                       counter        pcbValue    SQL_Array_type
  SQLBrowseConnect     counter        hdbc        SQL_Handle_type
  SQLCancel            counter        hstmt       SQL_Handle_type
  SQLColAttributes     counter        hstmt       SQL_Handle_type
  SQLColumnPrivileges  counter        hstmt       SQL_Handle_type
  SQLColumns           counter        hstmt       SQL_Handle_type
  SQLConnect           counter        hdbc        SQL_Handle_type
  SQLDataSources       counter        henv        SQL_Handle_type
  SQLDescribeCol       counter        hstmt       SQL_Handle_type
  SQLDescribeParam     counter        hstmt       SQL_Handle_type
  SQLDisconnect        counter        hdbc        SQL_Handle_type
  SQLDriverConnect     counter        hdbc        SQL_Handle_type
                       counter        hwnd        SQL_Handle_type
  SQLDrivers           counter        henv        SQL_Handle_type
  SQLError             counter        henv        SQL_Handle_type
                       counter        hdbc        SQL_Handle_type
                       counter        hstmt       SQL_Handle_type
  SQLExecDirect        counter        hstmt       SQL_Handle_type
  SQLExecute           counter        hstmt       SQL_Handle_type
  SQLExtendedFetch     counter        hstmt       SQL_Handle_type
                       counter        rgfRowStatus SQL_Array_type
  SQLFetch             counter        hstmt       SQL_Handle_type
  SQLForeignKeys       counter        hstmt       SQL_Handle_type
  SQLFreeConnect       counter        hdbc        SQL_Handle_type
  SQLFreeEnv           counter        henv        SQL_Handle_type
  SQLFreeStmt          counter        hstmt       SQL_Handle_type
  SQLGetConnectOption  counter        hdbc        SQL_Handle_type
                       counter        pvParam     SQL_Vector_type
  SQLGetCursorName     counter        hstmt       SQL_Handle_type
  SQLGetData           counter        hstmt       SQL_Handle_type
  SQLGetFunctions      counter        hdbc        SQL_Handle_type
                       counter        fExists     SQL_Array_type
  SQLGetInfo           counter        hdbc        SQL_Handle_type
                       counter        rgbInfoValue SQL_Vector_type
  SQLGetStmtOption     counter        hstmt       SQL_Handle_type
                       counter        pvParam     SQL_Vector_type
  SQLGetTypeInfo       counter        hstmt       SQL_Handle_type
  SQLMoreResults       counter        hstmt       SQL_Handle_type
  SQLNativeSql         counter        hdbc        SQL_Handle_type
  SQLNumParams         counter        hstmt       SQL_Handle_type
  SQLNumResultCols     counter        hstmt       SQL_Handle_type
  SQLParamOptions      counter        hstmt       SQL_Handle_type
  SQLPrepare           counter        hstmt       SQL_Handle_type
  SQLPrimaryKeys       counter        hstmt       SQL_Handle_type
  SQLProcedureColumns  counter        hstmt       SQL_Handle_type
  SQLProcedures        counter        hstmt       SQL_Handle_type
  SQLPutData           counter        hstmt       SQL_Handle_type
  SQLRowCount          counter        hstmt       SQL_Handle_type
  SQLSetConnectOption  counter        hdbc        SQL_Handle_type
                       counter        vParam      SQL_Vector_type
  SQLSetCursorName     counter        hstmt       SQL_Handle_type
  SQLSetPos            counter        hstmt       SQL_Handle_type
  SQLSetScrollOptions  counter        hstmt       SQL_Handle_type
  SQLSetStmtOption     counter        hstmt       SQL_Handle_type
                       counter        vParam      SQL_Vector_type
  SQLSpecialColumns    counter        hstmt       SQL_Handle_type
  SQLStatistics        counter        hstmt       SQL_Handle_type
  SQLTablePrivileges   counter        hstmt       SQL_Handle_type
  SQLTables            counter        hstmt       SQL_Handle_type
  SQLTransact          counter        henv        SQL_Handle_type
  	             counter        hdbc        SQL_Handle_type
As well, a few functions have an added parameter to help identify the
type of data contained in the SQL_Vector_type argument. This requirement
is caused by the ODBC function requirement that the data in the
SQL_Vector_type argument may be passed by value or by reference. All of
the underlying ODBC API functions have been deprecated and use of the
replacement functions is recommended. The affected functions are listed
in the following table along with their replacements:
FUNCTION ADDED ARG REPLACEMENT FUNCTION -------- --------- -------------------- SQLGetStmtOption ValueType SQLGetStmtAttr SQLSetConnectOption ValueType SQLSetConnectAttr SQLSetStmtOption ValueType SQLSetStmtAttr
| ------ | 
| ---- |