2014年3月29日15:33:28
MFC使用ADO在Oracle中查重
代码:
_bstr_t bstrPointSQL(_T("select SN from LWW_TEST where SN=774"));
try
{
pCenterRecordset->Open(bstrPointSQL, pCenterConnection.GetInterfacePtr(), adOpenDynamic, adLockOptimistic, adCmdText);
_variant_t var;
int nSn=0;int nX=0;int nY=0;
CString str;
bool bExist = false;
if (!pCenterRecordset->EndOfFile)
{
bExist = true;
}
pCenterRecordset->Close();
}catch (_com_error e)
{
exit(-1);
}