<% Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 'on error resume next 'server side include to add functionality... Private conn Private SQLstr Private RS Private RS2 Private RS3 Private SQLcmd Private objCmd SUB openConn set conn = server.createObject("ADODB.connection") conn.open "DSN=" & connectionDSN 'response.write "Just opened the connection object..." & "
" end sub SUB openRS(SQLstr) Set RS=server.createobject("ADODB.recordset") RS.open SQLstr, conn ,2 'response.write "Just opened the recordset..." & "
" end sub SUB openRS2(SQLstr) Set RS2=server.createobject("ADODB.recordset") RS2.open SQLstr, conn 'response.write "Just opened the recordset2..." & "
" end sub SUB openRS3(SQLstr) Set RS3=server.createobject("ADODB.recordset") RS3.open SQLstr, conn 'response.write "Just opened the recordset3..." & "
" end sub SUB openCmd(SQLcmd) SET objCmd = server.createObject("ADODB.command") SET objCmd.activeConnection = Conn objCmd.CommandText = SQLcmd objCmd.commandtype = 1 objCmd.execute 'response.write "Just opened a command object and executed..." & "
" end sub SUB cleanup if isObject(objCmd) THEN if objCmd is nothing then 'do nothing 'response.write "There was a command object, but it was not open..." & "
" else 'response.write "The Command object was just released..." & "
" SET objCmd = nothing end if else 'response.write "There was no exisiting command object..." & "
" end if if isObject(rs) THEN if rs is nothing then 'there's no recordset open 'response.write "There was a recordset, but it was not open..." & "
" else rs.close SET rs = nothing 'response.write "Just closed the recordset..." & "
" end if else 'response.write "There was no exisiting recordset object..." & "
" end if if isObject(Conn) then if conn is nothing then 'there's no connection open 'response.write "There was no connection object open.." else conn.close 'response.write "Just closed the connection..." SET conn = nothing end if else 'response.write "There was no exisiting connection object..." & "
" end if end sub SUB closeRS if isObject(rs) THEN if rs is nothing then 'there's no recordset open 'response.write "There was a recordset, but it was not open..." & "
" else rs.close SET rs = nothing 'response.write "Just closed the recordset..." & "
" end if else 'response.write "There was no exisiting recordset object..." & "
" end if end sub SUB closeRS2 if isObject(rs2) THEN if rs2 is nothing then 'there's no recordset2 open 'response.write "There was a recordset 2, but it was not open..." & "
" else rs2.close SET rs2 = nothing 'response.write "Just closed recordset2..." & "
" end if else 'response.write "There was no exisiting recordset2 object..." & "
" end if end sub SUB closeRS3 if isObject(rs3) THEN if rs3 is nothing then 'there's no recordset3 open 'response.write "There was a recordset 3, but it was not open..." & "
" else rs3.close SET rs3 = nothing 'response.write "Just closed recordset3..." & "
" end if else 'response.write "There was no exisiting recordset3 object..." & "
" end if end sub SUB closeCmd if isObject(objCmd) THEN if objCmd is nothing then 'do nothing 'response.write "There was a command object, but it was not open..." & "
" else 'response.write "The Command object was just released..." & "
" SET objCmd = nothing end if else 'response.write "There was no exisiting connection object..." & "
" end if END SUB %>