469,306 Members | 2,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

SQL Update Query Error

can someone tell me what is wrong with this query? I've tried every
combo that I can think of - adding &,"", "'", ) everywhere I can think
of and I keep getting an 'Expected end of statement error????

This is the query:
strSql = "UPDATE DE_change SET "
DE_change.BunName = "'" & Trim(Request.Form("txtBUN")) & "', " & _
DE_change.OwnerName = "'" & Trim(Request.Form("txtOwnerName")) & "', "
& _
DE_change.Manager = "'" & Trim(Request.Form("txtManager")) & "', " & _
DE_change.CCM = "'" & Trim(Request.Form("txtCCM")) & "', " & _
DE_change.LoadDate = "'" & Trim(Request.Form("txtLoadDate")) & "', " &
_
DE_change.ProdDate = "'" & Trim(Request.Form("txtProdDate")) & "', " &
_
DE_change.SubmissionDate = "'" & Trim(Request.Form("txtSubmitDate")) &
"', " & _
WHERE DE_change.load_id = Request.QueryString("LoadID")"

cnConnection.Execute(strSQL)

this is the error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Project2/Update_change.asp, line 22, column 6
WHERE DE_change.load_id = Request.QueryString("LoadID")"
Jul 19 '05 #1
4 6275
"WHERE DE_change.load_id = "n & Request.QueryString("LoadID")

Try writing out the sql statement before running it to see what you are
actually sending to the dbms.

--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
ms*****@ielearning.com
http://www.ielearning.com
714.637.9480 x17
"Lisa" <pe*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
can someone tell me what is wrong with this query? I've tried every
combo that I can think of - adding &,"", "'", ) everywhere I can think
of and I keep getting an 'Expected end of statement error????

This is the query:
strSql = "UPDATE DE_change SET "
DE_change.BunName = "'" & Trim(Request.Form("txtBUN")) & "', " & _
DE_change.OwnerName = "'" & Trim(Request.Form("txtOwnerName")) & "', "
& _
DE_change.Manager = "'" & Trim(Request.Form("txtManager")) & "', " & _
DE_change.CCM = "'" & Trim(Request.Form("txtCCM")) & "', " & _
DE_change.LoadDate = "'" & Trim(Request.Form("txtLoadDate")) & "', " &
_
DE_change.ProdDate = "'" & Trim(Request.Form("txtProdDate")) & "', " &
_
DE_change.SubmissionDate = "'" & Trim(Request.Form("txtSubmitDate")) &
"', " & _
WHERE DE_change.load_id = Request.QueryString("LoadID")"

cnConnection.Execute(strSQL)

this is the error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Project2/Update_change.asp, line 22, column 6
WHERE DE_change.load_id = Request.QueryString("LoadID")"

Jul 19 '05 #2
"WHERE DE_change.load_id = "n & Request.QueryString("LoadID")

That won't work? [see the 'n' after the closing double-quote] I presume it
was a typo in the post and the intent was:

"WHERE DE_change.load_id = " & Request.QueryString("LoadID")

Chris.

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl...
"WHERE DE_change.load_id = "n & Request.QueryString("LoadID")

Try writing out the sql statement before running it to see what you are
actually sending to the dbms.

--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
ms*****@ielearning.com
http://www.ielearning.com
714.637.9480 x17
"Lisa" <pe*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
can someone tell me what is wrong with this query? I've tried every
combo that I can think of - adding &,"", "'", ) everywhere I can think
of and I keep getting an 'Expected end of statement error????

This is the query:
strSql = "UPDATE DE_change SET "
DE_change.BunName = "'" & Trim(Request.Form("txtBUN")) & "', " & _
DE_change.OwnerName = "'" & Trim(Request.Form("txtOwnerName")) & "', "
& _
DE_change.Manager = "'" & Trim(Request.Form("txtManager")) & "', " & _
DE_change.CCM = "'" & Trim(Request.Form("txtCCM")) & "', " & _
DE_change.LoadDate = "'" & Trim(Request.Form("txtLoadDate")) & "', " &
_
DE_change.ProdDate = "'" & Trim(Request.Form("txtProdDate")) & "', " &
_
DE_change.SubmissionDate = "'" & Trim(Request.Form("txtSubmitDate")) &
"', " & _
WHERE DE_change.load_id = Request.QueryString("LoadID")"

cnConnection.Execute(strSQL)

this is the error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Project2/Update_change.asp, line 22, column 6
WHERE DE_change.load_id = Request.QueryString("LoadID")"


Jul 19 '05 #3
Can you post what the final 'constructed' SQL statement looks like (eg. do a
response.write or get it ion debug mode)?

Chris.

"Lisa" <pe*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
I've tried all your suggestions before I posted my message (adding & _
after the SET, adding '&' before and after the Query String, adding
["'" Trim(Request.Querystring("LoadID")) & "')"] - I'm at a loss as to
why I keep getting the error........confused?

~L~
Jul 19 '05 #4
Chris,
Sorry it took so long to respond... I've been away - I ended up
figuring out the problem and this is the code that worked....I was
missing my double quotes at the begining of the string

strSql = "UPDATE DE_change SET BunName = '" &
Trim(Request.Form("txtBUN")) & "', " & _
"OwnerName = '" & Trim(Request.Form("txtOwnerName")) & "', " & _
"Manager = '" & Trim(Request.Form("txtManager")) & "', " & _
"CCM = '" & Trim(Request.Form("txtCCM")) & "', " & _
"LoadDate ='" & Trim(Request.Form("txtLoadDate")) & "', " & _
"ProdDate ='" & Trim(Request.Form("txtProdDate")) & "', " & _
"SubmissionDate ='" & Trim(Request.Form("txtSubmitDate")) & "' " & _
"WHERE load_id = " & Request.QueryString("LoadID")

cnConnection.Execute(strSQL)

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message news:<#P**************@tk2msftngp13.phx.gbl>...
Can you post what the final 'constructed' SQL statement looks like (eg. do a
response.write or get it ion debug mode)?

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Steve Bishop | last post: by
6 posts views Thread by Nicolae Fieraru | last post: by
10 posts views Thread by Randy Harris | last post: by
7 posts views Thread by Mark Carlyle via AccessMonster.com | last post: by
reply views Thread by DP | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.