zoukankan      html  css  js  c++  java
  • 读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);
    }
  • 相关阅读:
    Less资源汇总
    Less函数说明
    Less使用说明
    Less 简介
    tomcat-users.xml 配置
    java project打包生成jar包(通用)
    5分钟理解String的'+'的性能及原理
    字符串"+"操作的原理
    Shell脚本实现对文件编辑
    mysql关于聚集索引、非聚集索引的总结
  • 原文地址:https://www.cnblogs.com/hongjiumu/p/3588273.html
Copyright © 2011-2022 走看看