<%option explicit%> <% 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("default.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.update updateRS.Close set updateRS = Nothing message = "

Update Successful

" end if '======================================== strSQL = "SELECT expire, id, newsdate, newstitle, newsbody, active 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 %> Edit News

<%=newstitle%>

<%=message%>
<% if active = "1" then%> <% else %> <% end if %>

reload