Quote Originally Posted by infomamun View Post
Yes, that will do. But for that, I have to change -
Global rsData As ADODB.Recordset to
Global rsData As New ADODB.Recordset
- in modCommon.bas
No you don't, and it's better if you don't - as explained in the article Why shouldn't I use "Dim .. As New .."? from our Classic VB FAQs (in the FAQ forum)

Rather than the "new" on that line, you should add another line:
Code:
Set rsData = New ADODB.Recordset
(this should go before you first try to use rsData)

Benifit of set rsData is that if I can set a Second rsData and it overrides the first one which prevents memory overload.
No it doesn't... the first one still exists, you just don't have access to it.

At some point ADO will work out that it needs to be tidied up, and do it automatically... but in the mean time, it wastes memory and can cause various problems based on locking etc.

To avoid that, you should tidy it up yourself (by closing it, and if you aren't going to use the same variable again set it to Nothing).
But using rsData.Open method, If I use rsData.Open second time for any reason, therewill be two instance of rsData(Recordset) as in modCommon, rsData is declared as New ADODB.Recordset or a second rsData cannot be opened without closing the first one which may create complicity in some cases.
You should close a recordset when you are done with it (no matter why you don't want the data any more). Doing that will allow you to re-open it with a different SQL statement, and takes just 2 lines of code:
Code:
rsData.Close
rsData.Open ....
However, more often than not you will want different recordsets (each having a different variable), or not want to use a recordset at all (such as for an Update SQL statement).