除了在mfc中可以用ado方式访问数据库外,可不可以在vc的sdk中以ado方式访问sql数据库?
如果可以,请问如何编写程序,有没有相关的实例?哪里可以找到?
谢谢!

解决方案 »

  1.   

    lz是不是把ado和dao搞混淆了?ado是Activex Data Objects 是微软的一套标准数据库访问接口。其构架在ole db之上,是对ole db的封装。
    DAO(Data Access Objects)是MFC封装的.这个比较古老啦。是微软提供针对.mdb文件的一种快速直接访问接口。
    “DAO supplies a hierarchical set of objects that use the Microsoft Jet database engine to access data and database structure in: Microsoft Jet (.MDB) databases 
    ODBC data sources, using an ODBC driver 
    Installable ISAM databases, such as dBASE and Paradox, which the database engine can read directly 
    To begin learning about the DAO technology, see the topic "Data Access Objects Overview" in DAO Help.”
    呵呵,上面一段摘至msdn.
      

  2.   

    呵呵,忘了说了ado和mfc没有任何关系。
    vc使用的时候
    可以#import "msado15.dll" \
        no_namespace rename("EOF", "EndOfFile")
    引入ado。
      

  3.   

    http://www.vckbase.com/document/viewdoc/?id=1471
    http://www.vckbase.com/document/viewdoc/?id=1557
      

  4.   

    有些数据库如mysql用api更方便