[thelist] Quick combine question
Groups at beachcomp.com
Groups at beachcomp.com
Tue Oct 6 12:20:57 CDT 2009
Hello all...
Can anyone point me in the right direction on combining all this code so it
reduces server stress by opening a single connection?
Thanks much!!!
<%
Function keywords1()
DataConn = "D:\Webspace\keywords.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
sConnString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &
DataConn & ";"
Conn.open(sConnString)
sql = "SELECT * FROM keywords where active=yes AND target=Yes"
Set RS = Conn.Execute(SQL)
If Not RS.Eof Then
While Not RS.Eof
keywords1 = keywords1 & RS("keyword")& ", "
RS.Movenext
wend
End If
Set RS = Nothing
Conn.close
Set Conn=Nothing
End Function
%>
<%
Function keywords2()
DataConn = "D:\Webspace\keywords.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
sConnString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &
DataConn & ";"
Conn.open(sConnString)
sql = "SELECT * FROM keywords where active=yes AND target=no"
Set RS = Conn.Execute(SQL)
If Not RS.Eof Then
While Not RS.Eof
keywords2 = keywords2 & RS("keyword")& ", "
RS.Movenext
wend
End If
Set RS = Nothing
Conn.close
Set Conn=Nothing
End Function
%>
<%
Function keywords()
keywords = keywords1 & keywords2
End Function
%>
More information about the thelist
mailing list