Microsoft Access 数据库引擎找不到输入表或查询“abcd”
本帖最后由 lovegame3 于 2012-11-11 18:58:26 编辑 代码如下
CString str,sql;
m_gzzz.GetLBText(m_gzzz.GetCurSel(),str);
sql="select * from abcd where abc = "+str+"";
try
{
m_pRs=theApp.m_pCon->Execute((_bstr_t)sql,NULL,adCmdText);
}
catch(_com_error& e)
{
CString strValue;
strValue.Format(_T("%s"),(LPCTSTR)e.Description());
AfxMessageBox(strValue);
}
MessageBox("456");
CString dbPath="Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+sysPath+"餐饮管理.accdb";求指点!!
sql="select * from abcd where abc = "+str+"";str代表的是文本,还要加上单引号'"str"',感兴趣的朋友可以看看我最近发的帖子,都是同一个问题,谢谢大家解答,问题解决,结贴给分。