|
<%
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=sqloledb;server=localhost;Database=links;Trusted_Connection=no;UID=aspRead;pwd=a$3r2Xg75$"
SQLStmt = "SELECT mcatalogue, catalogue, LserverName, LServerDesc, LserverHTTP" & _
" FROM links " & _
" inner join catalogue on links.catid=catalogue.id"&_
" inner join mcatalogue on catalogue.mcid=mcatalogue.mid"&_
" WHERE (OurServer=1 or patindex('%" & Request.ServerVariables("SERVER_NAME") & "%',LOurServer)<>0 ) and cweight>0" & _
" ORDER BY mweight desc, cweight desc, Lweight DESC;"
' response.write(SQLStmt)
Set links = Conn.Execute(SQLStmt)
' call geterror( err, conn)
if not links.eof then
if mcat<>links("mcatalogue") then
response.write " "
response.write "| "&trim(links("mcatalogue"))&" | "
response.write " "
end if
if cat<>links("catalogue") and links("catalogue")<>links("mcatalogue") then
response.write " "&trim(links("catalogue"))&" "
end if
cat=links("catalogue")
mcat=links("mcatalogue")
end if
while not links.eof
if mcat<>links("mcatalogue") then
response.write "
"
response.write "| "&trim(links("mcatalogue"))&" | "
response.write " "
mcat=links("mcatalogue")
end if
if cat<>links("catalogue") and links("catalogue")<>links("mcatalogue") then
response.write " "&trim(links("catalogue"))&" "
cat=links("catalogue")
end if
response.write(""&rtrim(links("Lservername"))&" ")
if trim(links("LServerDesc"))<>"" then
response.write(""&(replace(replace(links("LServerDesc"),"city",city),"country",country))&" ")
end if
links.movenext
wend
links.close
set links = nothing
conn.close
Set conn = nothing
%> |