我在Acess 里执行Sql 语句:insert into Account (sName) values ('test') 没问题,可是用代码执行,则报错失败,奇怪啦?
代码如下:
                  hr = pRs.CreateInstance(__uuidof(Recordset));
pRs->putref_ActiveConnection(m_pConn);
pRs->put_CacheSize(5000); 
pRs->PutLockType(adLockReadOnly);
pRs->PutCursorType(adOpenStatic); pCmd.CreateInstance(__uuidof(Command));
pCmd->putref_ActiveConnection(m_pConn);
pCmd->put_CommandType(adCmdUnknown);
pCmd->put_CommandText(_bstr_t(lpszSql)); pRs = pCmd->Execute(NULL, NULL, adCmdUnknown);谁知道为什么?