CString strSQL; strSQL.Format("select name, data from mydb where id = %d and company = '%s'", iID, sName); HRESULT hr = m_pRecordSet->Open(_bstr_t(strSQL),_variant_t((IDispatch *)m_pConnection,true), adOpenForwardOnly, adLockReadOnly, adCmdText); 其实就是格式化字符串
CString strSQL;
strSQL.Format("select name, data from mydb where id = %d and company = '%s'", iID, sName);
HRESULT hr = m_pRecordSet->Open(_bstr_t(strSQL),_variant_t((IDispatch *)m_pConnection,true), adOpenForwardOnly,
adLockReadOnly, adCmdText);
其实就是格式化字符串