我创建了一个ActiveX ControlWizard工作区,以下是我的语句
void CTest2PropPage::OnButton3() 
{
        
         CDatabase db;
db.Open(NULL,FALSE,FALSE,"ODBC;DSN=db1;UID=3515;PWD=3515");
CRecordSet dbmy(&db);
……}
但是编译出错说:error C2065: 'CRecordSet' : undeclared identifier
是什么原因啊?我的vc有问题还是在ocx中使用ODBC有其他要注意的?
#include "afxdb.h"我加入后也没有效果。一样报错

解决方案 »

  1.   

    在stdafx.h文件中加入#include <afxdb.h>即可
      

  2.   

    afxdb.h Add to Test2PropPage.cpp?
      

  3.   

    include "afxdb.h"
    =>
    include <afxdb.h>
    ?
      

  4.   

    include "afxdb.h"
    =>
    include <afxdb.h>
    ?
    都试过,没有用~!哭
      

  5.   

    CRecordset那个set原来要小写,我哭了。我的书都写错了,我就跟着盲从~谢谢楼上各位大哥帮忙啊!
      

  6.   

    再问个问题,怎么用CRecordset::requery()实现select name from mytab where id='1'?
    我看的好象都只能一行一行地访问记录啊?我如果只想要一行的一列的值呢?