conn.execute、rs.open、command.execute方法用法大大不同.docVIP

  • 10
  • 0
  • 约1.82千字
  • 约 3页
  • 2017-08-05 发布于河南
  • 举报

conn.execute、rs.open、command.execute方法用法大大不同.doc

conn.execute、rs.open、command.execute方法用法大大不同

conn.execute、rs.open、command.execute方法用法大大不同 通常形成记录集可以使用 Set rs=conn.execute(SQL) 或直接rs=CONN.execute(SQL) 和 Set rs=Server.CreateObject(ADODB.Recordset) rs.open SQL,CONN,0,1 或 rs.open SQL,CONN 这种情况 通常open比上一个性能要好那么一丁点 ( command对象更灵活,执行范围更广) 使用 CONN.execute 可以不用关闭直接执行下一个 set rs=conn.execute(SQL) 大约要慢 2~5倍!!(这是在msSQL循环1000次的),所以执行下一个 rs=conn.execute之前!!一定要关闭掉! 使用单一对象的rs rs.open在open下一个记录集之前,必需要求显示关闭,否则出错,速度在SQL,CONN,0,1的情况下可前者基本一样 所以使用设置一个 CreateObject(adodb.recordser) 最后一个 set rs=nothing 化上句号! open提供非常灵活的操作数据库元数据的非常多的属性!! 有很多情况下是非得用open来做的! 而conn.execute 非常单一!!! 比如: rs1.open SQL1,conn,0,1 rs.o

文档评论(0)

1亿VIP精品文档

相关文档