Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error in update statement!!

Status
Not open for further replies.

halfpint

Instructor
Mar 28, 2002
1
US
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(&quot;Key&quot;)
Set DBCon = Server.CreateObject(&quot;ADODB.Connection&quot;)
DBCon.Open &quot;Messageboard&quot;
SQLQ = &quot;Select * FROM status WHERE Key =&quot; & theKey
Set rs = DBCon.Execute(SQLQ)


%>

<form method=&quot;POST&quot; action=&quot;amendstatus.asp&quot;>


amendstatus.asp
' Get values from header '

SY = Request.Form(&quot;System&quot;)
PR = Request.Form(&quot;Problem&quot;)
DE = Request.Form(&quot;Details&quot;)
CD = Request.Form(&quot;Completiondate&quot;)
theKey = Request.Form(&quot;Key&quot;)

Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.open &quot;Messageboard&quot;
SQLstmt = &quot;UPDATE status SET &quot;
SQLStmt = SQLstmt & &quot;System='&quot; & SY & &quot;',&quot;
SQLstmt = SQLstmt & &quot;Problem=&quot; & PR & &quot;',&quot;
SQLstmt = SQLstmt & &quot;Details=&quot; & DE & &quot;',&quot;
SQLstmt = SQLstmt & &quot;Completiondate=&quot; & CD
SQLStmt = SQLStmt & &quot; WHERE (Key= &quot;&theKey&&quot;)&quot;
Set RS = Conn.Execute(SQLStmt)
rs.close
set rs=nothing
Conn.Close
set conn=nothing
 
Hi,
I'm not sure but I see some difference in coding

SQLStmt = SQLstmt & &quot;System='&quot; & SY & &quot;',&quot;
SQLstmt = SQLstmt & &quot;Problem=&quot; & PR & &quot;',&quot;
SQLstmt = SQLstmt & &quot;Details=&quot; & DE & &quot;',&quot;
SQLstmt = SQLstmt & &quot;Completiondate=&quot; & CD

So I think you forgot some '

Erik
 
And probably :

&quot;Completiondate='&quot; & CD & &quot;'&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top