两句语言,怎么改?
下面是我用ADO查询的语句(没问题),我想把30和50改成变量,如何改?
LPCTSTR lpStr=_T("select * from 泵型号参数 where 额定扬程>=30 and 额定扬程<=50 ");
pRecordset1.CreateInstance((_uuidof(Recordset)));
[解决办法]
CString strText(_T(""));
strText.Format(_T("select * from 泵型号参数 where 额定扬程>=%d and 额定扬程<=%d "), xx1, xx2);
[解决办法]
pRecordset1->Open((LPCTSTR)strText,conn1.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);