讨论,使用ADO与ODBC API函数访问数据库那个性能高?参与者有份!

解决方案 »

  1.   

    ActiveX Data Objects (ADO) is a high-level database API that sits on top of OLE DB. Compared to OLE DB, ADO programming is much simpler.  OLE DB is supplanting the venerable ODBC. OLE DB is newer, more modern, and more feature-rich. OLE DB encapsulates ODBC functionality for relational databases and also provides access to nonrelational data sources, such as data from spreadsheets, VSAM data (from mainframes), email systems, directory services, and so on.   The speed of the drivers for ODBC or OLE DB depends largely on the quality of the vendor's implementation. For at least a couple of the popular databases, namely SQL Server and Access, ODBC and OLE DB are highly optimized.   可以看出,效率的高低是取决于实现的代码,如果用ms数据库的话效率应该来说是ado比odbc高些,如果用其他数据库的话,最好用数据库本身提供的api,例如oracle的pl/sql c
      

  2.   

    我做了试验:
    win xp sp2  vss 6.0 + sp6 Release模式
    访问:Access数据库添加1000条数据,ODBC(900多)的比ADO(1400多)要快。另外浏览的时候他也比ADO的快.ado最大的优势容易掌握!
      

  3.   

    从性能上讲ODBC API绝对超过ADO,但ADO更易用,功能更强大。
      

  4.   

    不好意思,“如果用ms数据库的话效率应该来说是ado比odbc高些”,收会我说的话
    我自己也测试了下mysql,添加远程server上的10000条记录
    odbc  10.9秒
    ado   29.4秒
    mysqllib库   3.2秒还是得做测试才能下结论
      

  5.   

    大家试试这样,用ado的对象,但是连接字符串的时候用odbc的连接字符串
    这样可以同时拥有ado的方便和odbc的高效
      

  6.   

    喜欢ADO,可能是一开始做数据库就用ADO得原因把
      

  7.   

    这个没什么好讨论的,在处理并发量非常大的情况下,ODBC比ADO高出太多,但是ADO好于ADO.NET