<% thispage = "news.asp" %> <% ''Declare variables Dim adocon Dim adorst Dim strSQL ''Create ado connection object Set adocon = Server.CreateObject("ADODB.Connection") adocon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/guestdata.mdb") ''Create ado recordset object Set adorst = Server.CreateObject("ADODB.Recordset") ''Set SQL connection string strSQL = "SELECT id, footer FROM marquee;" ''Open recordset adorst.Open strSQL, adocon ''Query the database to check any existing records ''If no records found then tell the user that there are no records If adorst.EOF Then TxtToDisplay = "There is currently no news to report, please check back soon!" ''And show a link to sign in page Response.Write(TxtToDisplay) ''If records found then display them Else %>

News

<% While Not adorst.EOF Response.Write("") Response.Write("" & adorst("footer") & "") Response.Write("

") adorst.MoveNext Wend ''Close the recordset object adorst.Close Set adorst = Nothing ''Close the connection object and destroy it from the memory adocon.Close Set adocon = Nothing End if %>
Admin