这个简单的数据库的步骤为:
用向导生成一个不包括数据库支持的SDI程序,然后加一个对话框!
这一步之后怎么做才能使得这个对话框能够查询一个SQL Server数据库,并且可以将
选出的数据保存为.txt or .dbf格式的文件?
步骤详细一点!
谢谢帮助!

解决方案 »

  1.   


    include the header files:#include <afxdb.h> // MFC ODBC database classes
    #include <afxdao.h> // MFC DAO database classes
    ........in the stdAfx.h file.
      

  2.   

    select menu Insert|new class, you can insert a clase baseed on CRecordSet.
      

  3.   

    cdatabase db;
    db.open(...);//查msdn的参数表
    crecordset rs;
    rs=&db;
    rs.openex(...);//查msdn的参数表
    这样就可以了,不需要向导,此时已经生成了一个你所需要的结果集,你在openex函数中写sql语句也可以 db.execute(“insert...”)
    db.execute ("update...")    and so on!!!