should I close connection?



Hi all. I'm trying to fix a VB6 application that is returning
'Application error. The instruction at 0x7c8327f9 referenced memory at
0xffffffff' when it finishes (everything works fine, but when it's
supposed to end it returns this error).
I'm looking at the code for possible problems, and I found this that
looks suspicious:

Public Function ADId(DBConnectStr As String, ReportId As Integer) As
ADODB.Recordset
Dim ObjConn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String

strSQL = "Select * from tablet1 where Report_Id=" & CStr(ReportId) &
""

ObjConn.Open DBConnectStr
rs.Open strSQL, ObjConn, adOpenKeyset, adLockReadOnly

Set AllDistributionMethodbyReportId = rs
end function

So basically, it returns a recordset, but the application that calls
the function then closes the returning recordset and sets it to
nothing, but what about the connection? Does it get automatically
closed? Should I close it in the application before closing the
recordset? Could this be the problem?

.