• 读CRecordset


    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);
    }
  • 相关阅读:
    【linux 文件管理】7-文件重定向
    by David Bombal CCNA with kali linux
    【linux 文件管理】6-软链接和硬链接
    13.mysql索引的使用
    11.mysql SQL优化之SQL问题定位
    mysql服务常用命令
    10.mysql存储引擎
    9. Mysql的体系结构概览
    8.mysql触发器
    项目上线部署
  • 原文地址:https://www.cnblogs.com/hongjiumu/p/3588273.html
Copyright © 2020-2023  润新知