Forum Moderators: open
----------------------------------------------------------------------
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in UPDATE statement.
/purchase/UpdateUserRec.asp, line 21
i use the following code to do the update.,plsease note that "rec" is the variable that i pass thru from view form.
---------------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#Include file="connection.asp"-->
<%
'DecLare the variables
Dim SQLUpdateEdit
strUser = Request.Form("txtUser")
strPassword = Request.Form("txtPassword")
strARight = Request.Form("txtAccessRight")
strDeptCode = Request.Form("txtDeptCode")
strEmail = Request.Form("txtEmail")
SQLUpdateEdit = "UPDATE usertbl SET"
SQLUpdateEdit = SQLUpdateEdit & " user='" & strUser & "', "
SQLUpdateEdit = SQLUpdateEdit & " Passwd='" & strPassword & "', "
SQLUpdateEdit = SQLUpdateEdit & " ARight='" & strAright & "', "
SQLUpdateEdit = SQLUpdateEdit & " DeptCode='" & strDeptCode & "', "
SQLUpdateEdit = SQLUpdateEdit & " Email='" & strEmail & "'"
SQLUpdateEdit = SQLUpdateEdit & " WHERE user = '"& Request("rec") & ";"
conn.execute SQLUpdateEdit
conn.close
SET conn = Nothing
response.Redirect("EditSuccess.asp")
%>
----------------------------------------------------------------
thanks in advance!
response.write SQLUpdateEdit
'conn.execute SQLUpdateEdit
conn.close
SET conn = Nothing
'response.Redirect("EditSuccess.asp")
that will print the command string to your screen so you can look to see what values are being used for your variables
SQLUpdateEdit = SQLUpdateEdit & " WHERE user = '"& Request.querystring("rec") & "'"
response.write SQLUpdateEdit
'conn.execute SQLUpdateEdit
conn.close
SET conn = Nothing
response.Redirect("EditSuccess.asp")
%>
it direct to EditSuccess.asp but the table is not updated
after i remove ' for conn.execute SQLUpdateEdit
the same error message appear again.WEIRD~~
Help needed again.
If happen that anyone can resolve the error ,post the comment over here.
THank in advance