"select count(*) from game_menber where users=&username AND password=&password"这样行吗??其中uername  和password都是一个char*变量..

解决方案 »

  1.   

    CString s;
    s.Format(""select count(*) from game_menber where users='%s' AND password='%s'",username,password);
    db.ExecuteSql(s);
      

  2.   

    在format中不是有两个变量吗??
      

  3.   

    那在execute(s)怎么才只有一个呢?
      

  4.   

    大侠再帮我一个忙.
    我照你的打进去后(见下面这句)
     m_pRecordset=m_pConnection->Execute(s,&RecordsAffected,adCmdText);
    会出错的.
    error C2664: 'Execute' : cannot convert parameter 1 from 'class CString' to 'class _bstr_t'
    怎么办?
      

  5.   

    m_pRecordset=m_pConnection->Execute((_bstr_t)s,&RecordsAffected,adCmdText);