用VC+ADO操作数据库,什么连接方式效率最高?

---------------------------------------------------------------

不要用静态的,用动态只进游标速度会快。

动态游标执行完open后就有一条数据就位,静态的会把所有记录提取到内存中才从open返回
---------------------------------------------------------------

_bstr_t strCnn("Provider='sqloledb';Data Source='MySqlServer';"
"Initial Catalog='pubs';Integrated Security='SSPI';");

pConnection->Open(strCnn,"","",adConnectUnspecified);

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus