我的程序是用的ADO方式访问Access数据库的,在查询数据表的时候遇到了一个问题
就是我要根据一个对话框上传过来的变量作为查询关键字访问数据表,但是总是出错,还是一个未知的错误,这是我的源代码
CString Tester;
GetDlgItem(IDC_FIND_TESTER)->GetWindowText(Tester);
//  m_RecordID.GetWindowText(ID);
CString strSql;
strSql.Format("SELECT * FROM Tester_BaseInfo where FRecord=%s",Tester); UpdateData();
_RecordsetPtr m_pRecordset;
m_pRecordset.CreateInstance(__uuidof(Recordset));
try
{
m_pRecordset->Open((_bstr_t)strSql,                // 查询Tester_BaseInfo表中所有字段
m_pConnection.GetInterfacePtr(),  // 获取库接库的IDispatch指针
adOpenStatic,
adLockOptimistic,
adCmdText);
}
catch(_com_error *e)
{
AfxMessageBox(e->ErrorMessage());
}编译和连接都没有错,但是运行起来就出错,不知怎么回事,哪位达人帮忙解决一下,谢谢