我要查询数据库中test.mdb中的表label1中有没有usre=1,pass=2
这段程序怎么写啊?????

解决方案 »

  1.   

    CString str;
    str.Format("SELECT * FROM label1 WHERE usere = '%d' and pass = '%d'",变量1,变量2);
    m_pRecordset->Open(str.AllocSysString(),pApp->m_pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
    if(!m_pRecordset->adoEOF)
    {
          AfxMessageBox("有这样一个记录存在");
    }