void CDictCol::LoadDictCol(void)
{
// 加载数据字典信息CString cstrSql;
cstrSql.Format("SELECT dc.TblID, dc.TblName, dc.ColName, dc.ColIndex "
"FROM %s dc WHERE dc.TblID/10000 = %d ORDER BY TblName, ColIndex",
DB_TABLE_CFG_DICT_COL.c_str(), E3GLOG_ENS_VERSION_ID);CRecordset* pRecords = m_pOdbcHandle->GetRecordSet(cstrSql.GetBuffer());
if (NULL == pRecords)
{
return;
}
CString cstrTblID, cstrTblName, cstrField, cstrColIndex;
int iColBegin();
CString sPreTblName("");
while(!pRecords->IsEOF())
{
pRecords->GetFieldValue((SHORT), cstrTblID);
pRecords->GetFieldValue((SHORT), cstrTblName);
pRecords->GetFieldValue((SHORT), cstrField);
pRecords->GetFieldValue((SHORT), cstrColIndex);
if(cstrTblName != sPreTblName)
{
sPreTblName = cstrTblName;
iColBegin = ;
}
int nTblID = atoi(cstrTblID.GetString());
int nColIndex = atoi(cstrColIndex.GetString());
m_MapTblID[cstrTblName.Trim().GetBuffer()] = nTblID;
m_TblColInfo[cstrTblName.Trim().GetBuffer()][cstrField.Trim().GetBuffer()] = nColIndex;
pRecords->MoveNext();
}
m_pOdbcHandle->CloseRecordSet(pRecords);
}