SQLAllocHandle
Full Description
swirl
Syntax
  define external counter function SQLAllocHandle
     (  value counter HandleType,
        read-only SQL_handle_type InputHandle,
        read-only SQL_handle_type OutputHandle )


Purpose

Allocates an environment, connection, statement, or descriptor handle. This is a generic function for allocating handles. It replaces the following ODBC 2.x functions:

Input arguments:

  1. HandleType. The type of handle to be allocated. The following values are allowed:
    • SQL_HANDLE_ENV -- allocates an environment handle.
    • SQL_HANDLE_DBC -- allocates a database connection.
    • SQL_HANDLE_STMT -- allocates a statement handle.
    • SQL_HANDLE_DESC -- allocates a descriptor handle.
  2. InputHandle. The input handle in whose context the new handle is to be allocated. If the handle type is SQL_HANDLE_ENV, this is SQL_NULL_HANDLE. If the handle type is SQL_HANDLE_DBC, this must be an environment handle, and if it is SQL_HANDLE_STMT or SQL_HANDLE_DESC, it must be a connection handle. If the handle type is SQL_HANDLE_ENV and the target connection will be through an ODBC v2.x database driver, the SQL_ATTR_ODBC_VERSION attribute of the environment handle must be set to SQL_OV_ODBC2 using the SQLSetEnvAttr function before SQLAllocHandle is called. Otherwise, a function sequence error will be raised.
  3. OutputHandle. The returned handle.

Copyright © OmniMark Technologies Corporation, 1988-1998.