50 void Allocate(SQLSMALLINT type, SQLHANDLE hconn);
54 static std::wstring
GetError(SQLHANDLE handle,
int type);
56 static std::vector<ODBCError>
GetErrors(SQLHANDLE handle,
int type);
59 static std::vector<std::wstring>
GetDiagFields(SQLHANDLE handle,
int type,
int diagidentifier);
61 static std::vector<ODBCDiagnosticsMessage>
GetDiagMessages(SQLHANDLE handle,
int type);
std::wstring component
Identifies the component in which the error or warning occurred or that received the error or warning...
Definition: Handle.h:23
SQLHANDLE Peek() const
returns the ODBC handle
Definition: Handle.h:44
std::vector< ODBCError > GetErrors() const
get an array of errors on the current ODBC handle
Definition: Handle.h:65
std::vector< std::wstring > GetDiagFields(int diagidentifier) const
get an array of messages on the current ODBC handle
Definition: Handle.h:67
std::wstring GetError() const
get the text representation of the errors on an ODBC handle
Definition: Handle.h:63
An ODBC handle (smart pointer), bound to a connection.
Definition: Handle.h:31
std::wstring text
Generated by the ODBC component.
Definition: Handle.h:27
int native_error
Definition: Handle.h:14
void Allocate(SQLSMALLINT type, SQLHANDLE hconn)
allocates a handle, fails if a handle has been previously allocated
Definition: Handle.cpp:24
static std::vector< std::wstring > GetDiagFields(SQLHANDLE handle, int type, int diagidentifier)
Definition: Handle.cpp:49
SQLSMALLINT _type
type of handle
Definition: Handle.h:35
SQLHANDLE _hconn
ODBC connection handle.
Definition: Handle.h:39
std::vector< ODBCDiagnosticsMessage > GetDiagMessages() const
get an array of text messages on the current ODBC handle (cleaned up SQL_DIAG_MESSAGE_TEXT) ...
Definition: Handle.h:69
void Release()
releases the previously allocated handle, fails if no handle has been allocated
Definition: Handle.cpp:37
An ODBC error.
Definition: Handle.h:10
ODBCHandle()
Definition: Handle.cpp:8
std::wstring state
Definition: Handle.h:12
A diagnostics message, see http://msdn.microsoft.com/en-us/library/ms713606(VS.85).aspx.
Definition: Handle.h:18
virtual ~ODBCHandle()
Definition: Handle.cpp:16
SQLHANDLE PeekConnection() const
returns the connection handle
Definition: Handle.h:46
std::wstring message
Definition: Handle.h:13
SQLHANDLE _handle
ODBC handle.
Definition: Handle.h:37
std::wstring datasource
Identifies the data source. For file-based drivers, this is typically a file format, such as Xbase[1] For DBMS-based drivers, this is the DBMS product.
Definition: Handle.h:25
std::wstring vendor
Identifies the vendor of the component in which the error or warning occurred or that received the er...
Definition: Handle.h:21