473,408 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 6375
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve Bishop | last post by:
I'm having problems using an update query. I get the error: Server: Msg 8152, Level 16, State 9, Procedure SP_MemberUpdate, Line 3 String or binary data would be truncated. The statement has been...
6
by: Nicolae Fieraru | last post by:
Hi All, I was trying to update a field in a table, based on the results from a query. The table to be updated is tblCustomers and the query is qrySelect. This query has two parameters, provided...
10
by: Randy Harris | last post by:
I imported records into a table, later found out that many of them had trailing spaces in one of the fields. If I'd caught it sooner, I could have trimmed the spaces before the import. This...
4
by: deko | last post by:
I'm trying to update the address record of an existing record in my mdb with values from another existing record in the same table. In pseudo code it might look like this: UPDATE tblAddress SET...
7
by: Mark Carlyle via AccessMonster.com | last post by:
I have this update query that I am trying to run. I know the syntax is messed up but do not know how to correct it. Select 'UPDATE', Transactions,'Set = where = ' From "Get Daily Balances" ...
6
by: Greg Strong | last post by:
Hello All, In an 'Update' query can you use user-defined functions in the 'Update To' for the query? Either no or I'm missing something. See the additional info below. If I run a query...
0
by: DP | last post by:
hi, i;ve created an update query, which WORKS!!, i've got an update to check a checkbox in a film table, and i've got another update query to uncheck a checkbox, when a record is deleted. ...
2
by: Reedsp | last post by:
OS: MS XP Access version: 2003 SP2 I am trying to use an update query to replace quote marks with nothing. In essence, I'm removing quote marks. I get a error message when a field is empty or...
2
MindBender77
by: MindBender77 | last post by:
Hello again, All... Admin's, I wasn't sure where to post this, please move if in wrong forum. I'm using FrontPage 2003 to post form data to a second form to be used in an update query. The query...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.