<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body><h2>Update Record</h2>
<%
strtopic2 = Request.Form("topic2")
upost = Request.Form("Updatepost")
uview = Request.Form("Updateview")
udate = Request.Form("Updatedate")
utime = Request.Form("Updatetime")
database = "f:/forumdata.mdb"
sql="UPDATE forumdata SET topic = '" & upost & "', view = '"& uview &"', date= '"& udate &"', time = '"& utime &"' WHERE topic='" & strtopic2 & "'"
set conn=Server.CreateObject("ADODB.Connection")
conn.Open="Microsoft.Jet.OLEDB.4.0"
conn.Open "f:/forumdata.mdb"
set rs=Server.CreateObject("ADODB.recordset")
conn.Execute sql,conn
rs.Update
on error resume next
if err <> 0 then
response.write("No update permissions!")
else
response.write("Record " & lastaction & " was updated!")
end if
set rs = nothing
set conn = nothing
%>
</body>
</html>
What is the problem with the code?It prompt Syntax error in UPDATE statement.
|