L
Luis
In the code below I have a Response.End in the middle of a Do loop
that is run if the condition in a nested 'If...' statement is not met.
Will the rs and conn objects be closed and destroyed if the
Response.End is called or will they be left open?
connStr = "PROVIDER=OraOLEDB.Oracle; DATA SOURCE=xyz; etc..."
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connStr
rs = Set Conn.Execute("Select A,B,C from TblTableName Where Blah =
'Blah'")
Do While Not rs.eof
If rs("A") = "Tra la la" Then
'Do something
Else
Response.Write("Some message")
Response.End
End If
Loop
'Do other stuff...
rs.Close
Set rs = nothing
conn.Close
Set conn = nothing
that is run if the condition in a nested 'If...' statement is not met.
Will the rs and conn objects be closed and destroyed if the
Response.End is called or will they be left open?
connStr = "PROVIDER=OraOLEDB.Oracle; DATA SOURCE=xyz; etc..."
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connStr
rs = Set Conn.Execute("Select A,B,C from TblTableName Where Blah =
'Blah'")
Do While Not rs.eof
If rs("A") = "Tra la la" Then
'Do something
Else
Response.Write("Some message")
Response.End
End If
Loop
'Do other stuff...
rs.Close
Set rs = nothing
conn.Close
Set conn = nothing