首页 新闻 会员 周边 捐助

怎么只能更新到一条数据????

0
[待解决问题]

_bstr_t strConnect = "Provider=SQLOLEDB;Data Source=.;Initial Catalog=longkong;User ID=sa;Password=sa123456"; //打开数据库 p_connection1->Open(strConnect,"","",adModeUnknown);

CString sqlstr=""; sqlstr = "select OrderNo,Value from devvou "; //执行数据库语句 m_pRecordset = p_connection1->Execute((_bstr_t)sqlstr,NULL,adCmdText); //提取查询得到的参数

_variant_t showname = m_pRecordset->GetCollect ("OrderNo");

_variant_t detail = m_pRecordset->GetCollect ("Value");

CString stritemname =(char *)_bstr_t(showname);

stritemname.TrimRight();

CString strmeavalue =(char *)_bstr_t(detail); strmeavalue.TrimRight();

m_pRecordset-> MoveNext(); //关闭数据库连接

p_connection1->Close(); //新建一个新连接到自己的数据库

_bstr_t strConnectown = "Provider=SQLOLEDB;Data Source=.;Initial Catalog=ibms1;User ID=sa;Password=sa123456";

p_connection2->Open(strConnectown,"","",adModeUnknown);

CString sqlstr2="";

sqlstr2="update ibms_point_info set MeaValue='"+strmeavalue+"' where CPOINTID='"+stritemname+"'"; //更新自己的数据库

m_pRecordset = p_connection2->Execute((_bstr_t)sqlstr2,NULL,adCmdText); //关闭

p_connection2->Close(); }

catch(_com_error &e) { }

不忘初心,追随梦想的主页 不忘初心,追随梦想 | 菜鸟二级 | 园豆:206
提问于:2016-12-14 08:46
< >
分享
所有回答(2)
0

这样看起来有点乱。

代码飞了 | 园豆:470 (菜鸟二级) | 2016-12-14 11:10
0

乱码,谁有心情看

悦光阴 | 园豆:2251 (老鸟四级) | 2016-12-14 13:06
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册