|
#pragma once
typedef CTypedPtrMap<CMapStringToPtr, CString /* column name */, CDBVariantEx* /* value */> CODBCRecord;
typedef CTypedPtrArray<CObArray, CODBCRecord*> CODBCRecordArray;
class AFX_EXT_CLASS CODBCDynamic
{
public:
CODBCDynamic(LPCSTR lpszDSN,
LPCSTR lpszUser = NULL, LPCSTR lpszPassword = NULL,
SQLHENV henv = NULL, SQLHDBC hdbc = NULL);
// throws CUserException
~CODBCDynamic();
public:
enum
{
errorSqlAllocHandleHenv = 50000,
errorSqlSetEnvAttr = 50001,
errorSqlAllocHandleHdbc = 50002,
errorSqlConnect = 50003,
errorUnknownCause = 5004
};
protected:
void CleanOutRecordArray();
protected:
SQLHENV m_henv;
SQLHDBC m_hdbc;
BOOL m_bIsConnected;
public:
SQLHDBC GetHDBC ()
{
return m_hdbc;
}
public:
CODBCRecordArray m_ODBCRecordArray;
protected:
short GetFieldTypeFromSQLType(short nSQLType);
void* GetDataBuffer(CDBVariantEx* pvarValue, short nFieldType, int* pnLen, short nSQLType, UDWORD nPrecision);
long GetData(SQLHSTMT hstmt, short nFieldIndex, short nFieldType, LPVOID pvData, int nLen, short nSQLType);
public:
long ExecuteSQL(LPCTSTR lpszSQL);
long FetchData(HSTMT hstmt);
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
I manage the strategy for the Azure Management Experience documentation at Microsoft. Those technologies include Open-Source DevOps (Terraform, Ansible, Jenkins), Azure PowerShell, and Azure CLI.