HeaderPic
Car, Home, Pet & Travel Insurance
www.speedyquote.co.uk Homepage

Copyright © Speedyquote 2003 -
All rights reserved.

<% 'initialise objects and variables dim conn, strsql, rsfulllist, rscomplist, strMDBPath, comp, compname, lastcomp, i, player set conn=server.createobject("ADODB.Connection") set rsfulllist=server.createobject("ADODB.Recordset") strMDBpath = Server.MapPath("/databases/speedyquote.mdb") 'direct connection conn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & strMDBPath %> <%strsql = "SELECT NewsID, N_Date, N_Heading, N_Text, N_Hide, N_Page " strsql = strsql & "FROM News " strsql = strsql & "WHERE N_Hide <> -1 AND N_Page = 'I' " strsql = strsql & "ORDER BY N_Date DESC" 'response.write (strsql) rsfulllist.open strsql,conn,1,2 %> <%lastcomp = 0 i = 0 'iterate thro recordset Do while not rsfulllist.eof if rsfulllist("NewsID") = lastcomp then subWriteNewsLine rsfulllist("N_Text") i = i + 1 else subWriteNewsHead rsfulllist("N_Heading"),i subWriteNewsLine rsfulllist("N_Text") lastcomp = rsfulllist("NewsID") i = i + 1 end if rsfulllist.movenext Loop %> <% 'close resources used rsfulllist.close conn.close 'clean up set rsfulllist=nothing set conn=nothing %> <% Sub subWriteNewsHead(NHeading, ECount) response.write ("

" & NHeading & "") response.write ("
") End Sub %> <% Sub subWriteNewsLine(NText) response.write ("" & NText & "") End Sub %>