ado数据库查询问题
void CAdoRWAccessDlg::OnSelchangeComboname()
{
// TODO: Add your control notification handler code here
m_pRecordset->Close();
_variant_t var;
CString StrName="",StrSql="";
m_ComboName.GetWindowText(StrName);
StrSql.Format("select Age from DemoTable where Name=%s",StrName);
BSTR bsSql=StrSql.AllocSysString();
m_pRecordset->Open(bsSql,m_pConnection.GetInterfacePtr(),adOpenAsync,adLockOptimistic,adCmdText);//此处提示错误
var=m_pRecordset->GetCollect("Age");
m_Age=(LPCSTR)_bstr_t(var);
UpdateData(FALSE);
}
我建立了个数据库名Memo.mdb,表名DemoTable,表内字段名为Name和Age的两个字段。一个Combo Box和一个Edit,Combo Box为Name的列表,Edit用了显示Age。希望实现的功能是在Combo Box中选择一个Name,Edit中显示对应的Age。实现代码如上,可是编译时提示:error C2664: 'Open' : cannot convert parameter 3 from 'enum RecordOpenOptionsEnum' to 'enum CursorTypeEnum'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)。请帮忙解决