Sytax error in update - need help asap please!!!

Hey every one I am working on an application to update a user profile in ASP and Microsoft Access Database. I keep getting this error

[code]
Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/final/pUserCp.asp, line 54
[/code]

Here is my code that I am using as of now.

[code]
<%
Dim FName, LName, PID
sFName=Request.Form("tFName")
sLName=Request.Form("tLName")
PID=Request.Form("ID")

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("Access_db/OWS.mdb"))
sSQL = "Update tblPeople SET ([FName], [LName]) = ('" & sFName & "', '" & sLName & "') WHERE [ID] = " & PID & " "
response.Write(sSQL)
'############################# The next line is 54 #
conn.execute(sSQL)
conn.close
Response.Write("<font color=red>User " & session("Usr") & " was updated.")
%>
[/code]

with the linke response.Write(sSQL) It writes the following:

[code]Update tblPeople SET ([FName], [LName]) = ('Matthew', 'Phillips') WHERE [ID] = 1

Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/final/pUserCp.asp, line 54
[/code]

Please help me guys,just a little bit more information. This script worked fine when I was just trying to update my FName column, when I added LName it gave me the error.


Let me know if you need any more information!!!!

Thank you all in advance!

Comments

  • Try this:
    sSQL = "Update tblPeople SET [FName] = '" & sFName & "' , [LName] = '" & sLName & "' WHERE [ID] = " & PID & " "
    Sharbell K. Mouess
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion