p; CString m_strTableName;
CString m_strColumnName;
int m_nDataType;
CString m_strTypeName;
long m_nPrecision;
long m_nLength;
int m_nScale;
int m_nRadix;
int m_fNullable;
CString m_strRemarks;
virtual void DoFieldExchange(CFieldExchange*);
};
BOOL CColumns::Open(LPCSTR pszTableQualifier,
LPCSTR pszTableOwner,LPCSTR pszTableName,LPCSTR pszColumnName,
UINT nOpenType)
{
RETCODE nRetCode;
UWORD bFunctionExists;
//检验是否支持SQLColumns函数
AFX_SQL_SYNC(::SQLGetFunctions(m_pDatabase->m_hdbc,
SQL_API_SQLCOLUMNS,&bFunctionExists));
if (!Check(nRetCode) || !bFunctionExists)
{
if (!bFunctionExists)
TRACE(_T("SQLColumns 不支持\n"));
return FALSE;
}
//设置缓冲区状态,分配语句句柄
SetState(nOpenType,NULL,readOnly);
if (!AllocHstmt())
return FALSE;
TRY
{
OnSetOptions(m_hstmt);
AllocStatusArrays();
// 调用ODBC的SQLColumns函数
AFX_ODBC_CALL(::SQLColumns(m_hstmt,
(UCHAR FAR*)pszTableQualifier,SQL_NTS,