littlejones
12-07-2006, 07:56 PM
Can anyone help me out. I've been told I need to tidy up my code, and instead of having this sort of code in all of my pages...
Set objConn = Server.CreateObject(ADODB.Connection)
Set rs = Server.CreateObject(ADODB.RecordSet)
strSQL = "SET NO COUNT ON; " &_
"SELECT * FROM tblWhatever;"
rs.open strSQL, objConn
objConn.close
Set objConn = nothing
Set rs = nothing
I've been told I need to make a function or something that will save me writing all that code, but searching google I haven't found anything simple to follow.
If you can help that would be great!
Set objConn = Server.CreateObject(ADODB.Connection)
Set rs = Server.CreateObject(ADODB.RecordSet)
strSQL = "SET NO COUNT ON; " &_
"SELECT * FROM tblWhatever;"
rs.open strSQL, objConn
objConn.close
Set objConn = nothing
Set rs = nothing
I've been told I need to make a function or something that will save me writing all that code, but searching google I haven't found anything simple to follow.
If you can help that would be great!