| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 478 人关注过本帖
标题:求大神,怎样把II JJ KK 传入到sql语句中呢???
取消只看楼主 加入收藏
weichaoheng
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-6-14
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
求大神,怎样把II JJ KK 传入到sql语句中呢???
void CEx2View::OnButton2()
{
    // TODO: Add your control notification handler code here
    UpdateData(true);
    int II=2;  int JJ=2;  int KK=2;
    long m_1,m_2,m_3,m_00=0;

    CString str;               
    //str.Format("select * from frp3 where k='%s' ",K);
    //str.Format("select * from frp3 where i=2 and j=2 and k=2");
    str.Format("select * from frp3 where i='%d' and j='%d' and k='%d' ",II,JJ,KK);
               
                try
                {            
                    _variant_t RecordsAffected;
                    m_pRecordset =m_pConnection->Execute((_bstr_t)str,&RecordsAffected,adCmdText);
                    
                    _variant_t vCount;
                    
                    vCount = m_pRecordset->GetCollect("Cijkf");
                    m_1=vCount.lVal;
                    
                    vCount = m_pRecordset->GetCollect("Cijkrp");
                    m_2=vCount.lVal;   
                    
                    vCount = m_pRecordset->GetCollect("Cijkcl");
                    m_3=vCount.lVal;
                    
                    m_00=m_1+m_2+m_3;
                }
                catch(_com_error*e)
                {
                    AfxMessageBox(e->ErrorMessage());
                }

                m_0=m_00;   
                UpdateData(false);
}
搜索更多相关主题的帖子: sql语句 control where 
2013-06-14 17:39
快速回复:求大神,怎样把II JJ KK 传入到sql语句中呢???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026703 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved