ADO比ODBC慢吗? [英] Is ADO slower than ODBC?

查看:241
本文介绍了ADO比ODBC慢吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用ODBC和ADO来连接SQL和访问数据库的旧版应用程序中工作.

用VB3.0编写的组件使用ODBC dll,而用C ++编写的另一个组件使用ADO(msado25.dll).使用ODBC的VB3.0组件中的数据库访问比使用ADO的C ++组件快. (对于相同的查询)

有什么方法可以提高C ++组件的性能,而不是更改它以引用旧的ODBC?

任何帮助表示赞赏.

谢谢

Hi
I am working in a legacy application which uses both ODBC and ADO to connect to the SQL and access databases.

A component which is written in VB3.0 uses ODBC dll and another component written in C++ uses ADO(msado25.dll). Database access in VB3.0 component that uses ODBC is faster than the C++ component that uses ADO. (for same queries)

Is there any way i can improve the performance of the C++ component, rather than changing it to refer the older ODBC?

Any help is appreciated.

Thanks

推荐答案

简短的答案是也许".

ODBC更接近金属,因此在这方面它具有领先优势.

在C ++ ADO代码中,您可能要进行一些优化,以确保您正在读取的所有记录集都以只读和转发方式打开.

专注于处理时间最长的代码部分.在代码的这些部分中,其他低效率可能会变得很明显.

确保确定基准时间,以便您知道所做的更改是否有效果以及有多大作用.
The short answer is ''maybe''.

ODBC is closer to the metal, so it has a head start in this respect.

In the C++ ADO code, some optimizations you might make are insuring that any recordsets you''re reading are opened as readonly and forwardonly.

Concentrate on the parts of the code that is taking the longest to process. In those portions of code, other inefficiencies may become obvious.

Be sure to benchmark your timing so you know if your changes are making a difference and how much.


这篇关于ADO比ODBC慢吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆