for(int i=1;i<=12;i++)
{
m_pRecordset=m_pConnection->Execute("SELECT COUNT(*) FROM jiluo where time=(_variant_t)i ",&RecordsAffected,adCmdText);
}
怎样将i得值赋给time,我这样有错假如time=1这样就没错了,可是我要通过循环。
能教教我吗?
{
m_pRecordset=m_pConnection->Execute("SELECT COUNT(*) FROM jiluo where time=(_variant_t)i ",&RecordsAffected,adCmdText);
}
怎样将i得值赋给time,我这样有错假如time=1这样就没错了,可是我要通过循环。
能教教我吗?
{
CString temp;
temp.Format("SELECT COUNT(*) FROM jiluo where time=%d",i);
m_pRecordset=m_pConnection->Execute(temp,&RecordsAffected,adCmdText);
}
char istr[3];
itoa(i,istr,10);
后CString sql = "..."+istr+"...";
s.Format("d%",i);
m_pRecordset=m_pConnection->Execute("SELECT COUNT(*) FROM jiluo where time=s",&RecordsAffected,adCmdText);
我将它改成这样,不过还是不行呀?
照你这个写法,应该是
CString s,str;
s.Format("d%",i);
str="SELECT COUNT(*) FROM jiluo where time=";
str=str+ s;
m_pRecordset=m_pConnection->Execute(str,&RecordsAffected,adCmdText);
No constructor could take the source type, or constructor overload resolution was ambiguous
还是不行呀
有这样的错