为什么要关闭和销毁记录集? [英] Why should I close and destroy a recordset?

查看:18
本文介绍了为什么要关闭和销毁记录集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过这篇文章:http://www.utteraccess.com/wiki/Recordsets_for_Beginners,它说像这样关闭和销毁 RS 对我来说很重要:
rs.close设置 rs = 无
如果我不这样做,可能会发生一些错误.

I read this article: http://www.utteraccess.com/wiki/Recordsets_for_Beginners, and it says that it's important for me to close and destroy RS's like this:
rs.close Set rs = Nothing
and if I don't, some bugs may happen.

  1. 什么样的错误?
  2. rs.close 是什么意思?这是否意味着只要 rs 没有关闭,与数据库的连接就会保持打开状态?
  1. What kind of bugs?
  2. What does rs.close means? Does it mean that the connection to the database is kept open for as long as the rs isn't closed?

推荐答案

rs.close 清理内部使用的资源,但是因为 ASP 是一个没有任何 GC 的单一进程Set rs = Nothing 有助于清理.

rs.close cleans up the resources that are used internally, however because ASP is a single process that doesn't have any GC the Set rs = Nothing aids in the clean up.

它取消引用你的对象,没有它你会有内存泄漏.不错吧?

It de-references your objects, without it you'll have a memory leak. nice isn't it?

这篇关于为什么要关闭和销毁记录集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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