Brunel 200 - News Management System <% id = request("id") if id < 1 then response.write (errormsg) response.end end if Set dConn = Server.CreateObject("ADODB.Connection") dConn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & database_path '======================================== if request.form("ispostback") = 1 then set updateRS = Server.CreateObject("ADODB.RecordSet") updateSQL = "SELECT * from tblnews where ID = " & ID & ";" updateRS.Open updateSQL,dConn, 1,3 urecordcount = updateRS.recordcount if urecordcount <> 1 then updateRS.Close Set updateRS = Nothing response.redirect("index.asp?norecord") end if updateRS("newsdate") = checkdate(request.form("newsdate")) updateRS("expire") = checkdate(request.form("expire")) updateRS("newstitle") = Presubmit2(request.form("newstitle")) updateRS("newsbody") = Presubmit2(request.form("newsbody")) updateRS("active") = request.form("active") updateRS("linktitle") = request.form("linktitle") updateRS("linkurl") = request.form("linkurl") updateRS("imageurl") = request.form("imageurl") updateRS.update updateRS.Close set updateRS = Nothing Response.Redirect("news-admin.asp?message=Update Successful") end if '======================================== strSQL = "SELECT expire, id, newsdate, newstitle, newsbody, active, linktitle, linkurl, imageurl from tblnews where ID = " & ID & ";" Set newsRS = Server.CreateObject("ADODB.recordset") newsRS.Open strSQL, dConn, 1, 3 recordcount = newsrs.recordcount if recordcount < 1 then newsRS.close set newsRS = nothing dConn.close set dConn = nothing response.write (errormsg) Response.end end if For fnum = 0 To newsRS.Fields.Count-1 execute(newsRS.Fields(fnum).Name & " = newsRS(" & CHR(34) & newsRS.Fields(fnum).Name & CHR(34) & ")") Next if newsbody <> "" then newsbody = undo(newsbody) end if %> <%=message%>
<%=newstitle%>