I've inherited a web app to maintain and modify. I'm used to ADO, but in a fat-client setting. I'm still figuring out to what extent global (asa or include) functions can pass connection and rs objects.
The sub used in a globalinclude file is:
[tt]Sub SetUpAndOpenRecordSet(ByRef rsRS, strSource)
set rsRS=Server.CreateObject("ADODB.Recordset"
rsRS.ActiveConnection="dsn=ECAP;"
rsRS.Source = strSource
'rsRS.CursorType = 0
'rsRS.CursorLocation = 2
rsRS.CursorType = 2
rsRS.CursorLocation = 3
rsRS.LockType = 3
rsRS.Open
End Sub
[/tt]
It's called thus: [tt]
SetupAndOpenRecordset rsProcesses, strSQL[/tt]
Here's the question(s): This gives a working recordset in the local sub, and I'm now going back and putting in cleanup to .Close and Set = Nothing at the local level.
Does the rsRS in the globalsub still remain open?
Would it be better to make the global sub a function that RETURNS a Rs object and then closes the Rs object in the global sub? Jeff Roberts
Analysis, Design, & Implementation
RenaissanceData.com
The sub used in a globalinclude file is:
[tt]Sub SetUpAndOpenRecordSet(ByRef rsRS, strSource)
set rsRS=Server.CreateObject("ADODB.Recordset"
rsRS.ActiveConnection="dsn=ECAP;"
rsRS.Source = strSource
'rsRS.CursorType = 0
'rsRS.CursorLocation = 2
rsRS.CursorType = 2
rsRS.CursorLocation = 3
rsRS.LockType = 3
rsRS.Open
End Sub
[/tt]
It's called thus: [tt]
SetupAndOpenRecordset rsProcesses, strSQL[/tt]
Here's the question(s): This gives a working recordset in the local sub, and I'm now going back and putting in cleanup to .Close and Set = Nothing at the local level.
Does the rsRS in the globalsub still remain open?
Would it be better to make the global sub a function that RETURNS a Rs object and then closes the Rs object in the global sub? Jeff Roberts
Analysis, Design, & Implementation
RenaissanceData.com