By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

SQL Update Query Error

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
"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

P: n/a
"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

P: n/a
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

P: n/a
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.