I have created a display records page with amend buttons, the next page is a form which allows the user to amend the information but when I click on submit I get an error message as above and I am going mad - help!!
amend.asp
<%
theKey = Request.QueryString("Key"
Set DBCon = Server.CreateObject("ADODB.Connection"
DBCon.Open "Messageboard"
SQLQ = "Select * FROM status WHERE Key =" & theKey
Set rs = DBCon.Execute(SQLQ)
%>
<form method="POST" action="amendstatus.asp">
amendstatus.asp
' Get values from header '
SY = Request.Form("System"
PR = Request.Form("Problem"
DE = Request.Form("Details"
CD = Request.Form("Completiondate"
theKey = Request.Form("Key"
Set Conn = Server.CreateObject("ADODB.Connection"
conn.open "Messageboard"
SQLstmt = "UPDATE status SET "
SQLStmt = SQLstmt & "System='" & SY & "',"
SQLstmt = SQLstmt & "Problem=" & PR & "',"
SQLstmt = SQLstmt & "Details=" & DE & "',"
SQLstmt = SQLstmt & "Completiondate=" & CD
SQLStmt = SQLStmt & " WHERE (Key= "&theKey&""
Set RS = Conn.Execute(SQLStmt)
rs.close
set rs=nothing
Conn.Close
set conn=nothing
amend.asp
<%
theKey = Request.QueryString("Key"
Set DBCon = Server.CreateObject("ADODB.Connection"
DBCon.Open "Messageboard"
SQLQ = "Select * FROM status WHERE Key =" & theKey
Set rs = DBCon.Execute(SQLQ)
%>
<form method="POST" action="amendstatus.asp">
amendstatus.asp
' Get values from header '
SY = Request.Form("System"
PR = Request.Form("Problem"
DE = Request.Form("Details"
CD = Request.Form("Completiondate"
theKey = Request.Form("Key"
Set Conn = Server.CreateObject("ADODB.Connection"
conn.open "Messageboard"
SQLstmt = "UPDATE status SET "
SQLStmt = SQLstmt & "System='" & SY & "',"
SQLstmt = SQLstmt & "Problem=" & PR & "',"
SQLstmt = SQLstmt & "Details=" & DE & "',"
SQLstmt = SQLstmt & "Completiondate=" & CD
SQLStmt = SQLStmt & " WHERE (Key= "&theKey&""
Set RS = Conn.Execute(SQLStmt)
rs.close
set rs=nothing
Conn.Close
set conn=nothing