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);
    }
  • 相关阅读:
    Linux常用命令
    jQuery
    NPM 常用命令
    Linux中mkdir和touch命令区别
    linux下cat命令详解
    时间
    es5中foreach的用法
    简单的下拉框制作
    window内置对象学习
    [Leetcode]5.Longest Palindromic Substring
  • 原文地址:https://www.cnblogs.com/hongjiumu/p/3588273.html
Copyright © 2011-2022 走看看