<% Dim lngNewsID 'Holds the ID number of the News Item Dim rsNews 'Database recordset holding the news items Dim strAuthor 'Holds the username of the author Dim strNewsItem 'Holds the news item 'If thiss is editing a news item then get it from the database If Request.QueryString("mode") = "edit" Then 'Create recorset object Set rsNews = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT tblNews.News_item, tblNews.Short_news " strSQL = strSQL & "FROM tblNews " strSQL = strSQL & "WHERE tblNews.News_ID = " & CLng(Request.QueryString("NewsItem")) & ";" 'Query the database rsNews.Open strSQL, objADO 'Get teh short news item If NOT rsNews.EOF AND Request.QueryString("item") = "short" Then strNewsItem = rsNews("Short_news") 'Get the long news item If NOT rsNews.EOF AND Request.QueryString("item") = "long" Then strNewsItem = rsNews("News_item") 'Close recordset rsNews.Close Set rsNews = Nothing End If 'Reset Sever Objects Set objADO = Nothing Set strCon = Nothing %> <% = strNewsItem %>