printf("%ld\t", V_I4(&pItemState[0].vDataValue));
显示5.885
以下的代码能中temp=8.9能下入oracle数据库
char strsql[100];
sprintf(strsql,"update c0de_tank_temp set temp=8.9 where tempname='TI107A' ");
m_pConnection->Execute(strsql, &RecordsAffected,adCmdText);
m_pRecordset->Close();
m_pRecordset = NULL; 我现在想把(&pItemState[0].vDataValue的值赋给temp,应该怎么写,我试过好多次,都不成功,请高手指教!谢谢!
显示5.885
以下的代码能中temp=8.9能下入oracle数据库
char strsql[100];
sprintf(strsql,"update c0de_tank_temp set temp=8.9 where tempname='TI107A' ");
m_pConnection->Execute(strsql, &RecordsAffected,adCmdText);
m_pRecordset->Close();
m_pRecordset = NULL; 我现在想把(&pItemState[0].vDataValue的值赋给temp,应该怎么写,我试过好多次,都不成功,请高手指教!谢谢!
这个不行吗?
float ftemp=V_I4(&pItemState[0].vDataValue);
printf("%lf",ftemp);
//打印一下,ftemp的值为0吗
char strsql[100];
sprintf(strsql,"update c0de_tank_temp set temp=%lf where tempname='TI107A' ",ftemp);