% id = request.querystring("id") if request.form = "" then 'No submit yet if id <> "" then 'Get existing data sqltext = "SELECT * FROM news WHERE id = " & id rs.Open sqltext, Conn,2,2 BodyText = trim(rs("BodyText")) Location = trim(rs("Location")) Headline = trim(rs("Headline")) theDate = trim(rs("theDate")) theTime = trim(rs("theTime")) Archive = rs("Archive") rs.close end if else 'Update/Insert Message = "Error Processing request" if id <> "" then sqltext = "SELECT * FROM news WHERE id = " & id rs.Open sqltext, Conn,2,2 else sqltext = "SELECT * FROM news" rs.Open sqltext, Conn,2,2 rs.AddNew end if rs("BodyText") = request.form("BodyText") rs("Location") = request.form("Location") rs("Headline") = request.form("Headline") theDate = request.form("theDate") if theDate = "" then theDate = Date rs("theDate") = theDate theTime = request.form("theTime") if request.form("Archive") <> "" then rs("Archive") = request.form("Archive") else rs("Archive") = 0 end if if theTime = "" then theTime = Time rs("theTime") = theTime rs.Update rs.close response.redirect "index.asp" end if Conn.close %>