我为什么要关闭和销毁记录? [英] Why should I close and destroy a recordset?
问题描述
我读这篇文章: http://www.utteraccess.com/wiki/index的.php / Recordsets_for_Beginners 和它说,对我来说,关闭和销毁RS的这个样子是很重要的:结果 rs.close
结果
集RS =什么
如果我不这样做,一些错误可能发生。
- 什么样的虫子?
- 这是什么
rs.close
意味着什么?这是否意味着到数据库的连接将保持打开状态,只要RS
未关闭?
rs.close
清理在内部使用的资源,但是因为ASP是一个单一的过程,没有任何GC的设置RS =在清理没有
的辅助工具。
据去引用你的对象,没有它你将有一个内存泄漏。不错,不是吗?
I read this article: http://www.utteraccess.com/wiki/index.php/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.
- What kind of bugs?
- What does
rs.close
means? Does it mean that the connection to the database is kept open for as long as thers
isn't closed?
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屋!