Products Support Documentation Download
ODBC Connection Functions
Collaboration diagram for ODBC Connection Functions:

Functions

SQLRETURN SQLConnect (SQLHDBC ConnectionHandle, const SQLCHAR *ServerName, SQLSMALLINT NameLength1, const SQLCHAR *UserName, SQLSMALLINT NameLength2, const SQLCHAR *Authentication, SQLSMALLINT NameLength3)
 Establish a connection to the database source. More...
 
SQLRETURN SQLDataSources (SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
 Browse data sources. More...
 
SQLRETURN SQLDisconnect (SQLHDBC ConnectionHandle)
 Disconnect from the database source. More...
 
SQLRETURN SQLGetConnectAttr (SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
 Obtain an attribute of the ODBC connection. More...
 
SQLRETURN SQLGetFunctions (SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported)
 Return whether or not a specific ODBC function is supported. More...
 
SQLRETURN SQLGetInfo (SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
 Return the information about the ODBC driver and data source. More...
 
SQLRETURN SQLSetConnectAttr (SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength)
 Set an attribute of the ODBC connection. More...
 
SQLRETURN SQLNativeSql (SQLHDBC ConnectionHandle, const SQLCHAR *InStatementText, SQLINTEGER TextLength1, SQLCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2Ptr)
 Return an SQL statement as modified by the ODBC driver. More...
 

Detailed Description

Function Documentation

◆ SQLConnect()

SQLRETURN SQLConnect ( SQLHDBC  ConnectionHandle,
const SQLCHAR ServerName,
SQLSMALLINT  NameLength1,
const SQLCHAR UserName,
SQLSMALLINT  NameLength2,
const SQLCHAR Authentication,
SQLSMALLINT  NameLength3 
)

#include <sql.h>

Establish a connection to the database source.

See http://msdn.microsoft.com/en-us/library/ms711810(v=vs.85).aspx

◆ SQLDataSources()

SQLRETURN SQLDataSources ( SQLHENV  EnvironmentHandle,
SQLUSMALLINT  Direction,
SQLCHAR ServerName,
SQLSMALLINT  BufferLength1,
SQLSMALLINT NameLength1,
SQLCHAR Description,
SQLSMALLINT  BufferLength2,
SQLSMALLINT NameLength2 
)

◆ SQLDisconnect()

SQLRETURN SQLDisconnect ( SQLHDBC  ConnectionHandle)

#include <sql.h>

Disconnect from the database source.

See http://msdn.microsoft.com/en-us/library/ms713946(v=vs.85).aspx

◆ SQLGetConnectAttr()

SQLRETURN SQLGetConnectAttr ( SQLHDBC  ConnectionHandle,
SQLINTEGER  Attribute,
SQLPOINTER  Value,
SQLINTEGER  BufferLength,
SQLINTEGER StringLength 
)

#include <sql.h>

Obtain an attribute of the ODBC connection.

See http://msdn.microsoft.com/en-us/library/ms710297(v=vs.85).aspx

◆ SQLGetFunctions()

SQLRETURN SQLGetFunctions ( SQLHDBC  ConnectionHandle,
SQLUSMALLINT  FunctionId,
SQLUSMALLINT Supported 
)

#include <sql.h>

Return whether or not a specific ODBC function is supported.

See http://msdn.microsoft.com/en-us/library/ms709291(v=vs.85).aspx

◆ SQLGetInfo()

SQLRETURN SQLGetInfo ( SQLHDBC  ConnectionHandle,
SQLUSMALLINT  InfoType,
SQLPOINTER  InfoValue,
SQLSMALLINT  BufferLength,
SQLSMALLINT StringLength 
)

#include <sql.h>

Return the information about the ODBC driver and data source.

See http://msdn.microsoft.com/en-us/library/ms711681(v=vs.85).aspx

◆ SQLNativeSql()

SQLRETURN SQLNativeSql ( SQLHDBC  ConnectionHandle,
const SQLCHAR InStatementText,
SQLINTEGER  TextLength1,
SQLCHAR OutStatementText,
SQLINTEGER  BufferLength,
SQLINTEGER TextLength2Ptr 
)

#include <sqlext.h>

Return an SQL statement as modified by the ODBC driver.

See http://msdn.microsoft.com/en-us/library/ms714575(v=vs.85).aspx

◆ SQLSetConnectAttr()

SQLRETURN SQLSetConnectAttr ( SQLHDBC  ConnectionHandle,
SQLINTEGER  Attribute,
SQLPOINTER  Value,
SQLINTEGER  StringLength 
)

#include <sql.h>

Set an attribute of the ODBC connection.

See http://msdn.microsoft.com/en-us/library/ms713605(v=vs.85).aspx