W
WG
Here is an ASP code sample in VBScript:
<%
Dim x
Set x = server.CreateObject("ADODB.RECORDSET")
x.CursorType = 1
x.CursorLocation = 3
x.Fields.Append "custtype", adVarNumeric, 80, adFldMayBeNull
x.Open
x.addnew "custtype", 34
x.Update
call dothis(x)
Response.Write(x.RecordCount)
Set x = nothing
Function dothis(byval x)
x.addnew "custtype", 34
Response.Write(x.RecordCount & "<BR>")
x.addnew "custtype", 34
Response.Write(x.RecordCount & "<BR>")
set x = nothing
End Function
%>
This should run if you put it into an asp page and pull it from IIS.
It is just a disconnected recordset filled with a record and then a
response.write, etc.
Question: I'm using "byval" in the dothis() function, but SHOULD I
set x = nothing within the function? Obviously when using, "byref",
setting x = nothing will delete the instance of the object, but with
"byval" will I leave something in memory if I don't set x = nothing?
I think this is another "age old" question but I've got some pages
acting funky on a hosted server in Canada and I think this issue may
have something to do with it.
<%
Dim x
Set x = server.CreateObject("ADODB.RECORDSET")
x.CursorType = 1
x.CursorLocation = 3
x.Fields.Append "custtype", adVarNumeric, 80, adFldMayBeNull
x.Open
x.addnew "custtype", 34
x.Update
call dothis(x)
Response.Write(x.RecordCount)
Set x = nothing
Function dothis(byval x)
x.addnew "custtype", 34
Response.Write(x.RecordCount & "<BR>")
x.addnew "custtype", 34
Response.Write(x.RecordCount & "<BR>")
set x = nothing
End Function
%>
This should run if you put it into an asp page and pull it from IIS.
It is just a disconnected recordset filled with a record and then a
response.write, etc.
Question: I'm using "byval" in the dothis() function, but SHOULD I
set x = nothing within the function? Obviously when using, "byref",
setting x = nothing will delete the instance of the object, but with
"byval" will I leave something in memory if I don't set x = nothing?
I think this is another "age old" question but I've got some pages
acting funky on a hosted server in Canada and I think this issue may
have something to do with it.