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(0); CString sPreTblName(""); while(!pRecords->IsEOF()) { pRecords->GetFieldValue((SHORT)0, cstrTblID); pRecords->GetFieldValue((SHORT)1, cstrTblName); pRecords->GetFieldValue((SHORT)2, cstrField); pRecords->GetFieldValue((SHORT)3, cstrColIndex); if(cstrTblName != sPreTblName) { sPreTblName = cstrTblName; iColBegin = 0; } 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); }