Question

  Asked: Mar 8 2008   3:11 PM GMT
  Asked by: Ritesh18a


Recordet


VB, Recordset, Visual Basic

Why we close/destroy recordset in vb? Is it good practise to close/ destroy recordset?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Yes it is a good practise to close and destroy the record set.

A couple of reasons that we close and destroy the record set are:

1. To reclaim memory on the client machine. When we keep the record set in memory for no reason we are wasting the memory which can be used for other things.
2. To close the connection to the database. When we are using a RDBMS such as Oracle or SQL Server each connection to the database takes memory on the database server. By keeping the connections open we are holding memory in use for no reason which could be reused for another connection or process.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register