473,594 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.BunNa me = "'" & Trim(Request.Fo rm("txtBUN")) & "', " & _
DE_change.Owner Name = "'" & Trim(Request.Fo rm("txtOwnerNam e")) & "', "
& _
DE_change.Manag er = "'" & Trim(Request.Fo rm("txtManager" )) & "', " & _
DE_change.CCM = "'" & Trim(Request.Fo rm("txtCCM")) & "', " & _
DE_change.LoadD ate = "'" & Trim(Request.Fo rm("txtLoadDate ")) & "', " &
_
DE_change.ProdD ate = "'" & Trim(Request.Fo rm("txtProdDate ")) & "', " &
_
DE_change.Submi ssionDate = "'" & Trim(Request.Fo rm("txtSubmitDa te")) &
"', " & _
WHERE DE_change.load_ id = Request.QuerySt ring("LoadID")"

cnConnection.Ex ecute(strSQL)

this is the error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Project2/Update_change.a sp, line 22, column 6
WHERE DE_change.load_ id = Request.QuerySt ring("LoadID")"
Jul 19 '05 #1
4 6382
"WHERE DE_change.load_ id = "n & Request.QuerySt ring("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*****@ielearn ing.com
http://www.ielearning.com
714.637.9480 x17
"Lisa" <pe*****@yahoo. com> wrote in message
news:89******** *************** ***@posting.goo gle.com...
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.BunNa me = "'" & Trim(Request.Fo rm("txtBUN")) & "', " & _
DE_change.Owner Name = "'" & Trim(Request.Fo rm("txtOwnerNam e")) & "', "
& _
DE_change.Manag er = "'" & Trim(Request.Fo rm("txtManager" )) & "', " & _
DE_change.CCM = "'" & Trim(Request.Fo rm("txtCCM")) & "', " & _
DE_change.LoadD ate = "'" & Trim(Request.Fo rm("txtLoadDate ")) & "', " &
_
DE_change.ProdD ate = "'" & Trim(Request.Fo rm("txtProdDate ")) & "', " &
_
DE_change.Submi ssionDate = "'" & Trim(Request.Fo rm("txtSubmitDa te")) &
"', " & _
WHERE DE_change.load_ id = Request.QuerySt ring("LoadID")"

cnConnection.Ex ecute(strSQL)

this is the error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Project2/Update_change.a sp, line 22, column 6
WHERE DE_change.load_ id = Request.QuerySt ring("LoadID")"

Jul 19 '05 #2
"WHERE DE_change.load_ id = "n & Request.QuerySt ring("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.QuerySt ring("LoadID")

Chris.

"Mark Schupp" <ms*****@ielear ning.com> wrote in message
news:eV******** ******@TK2MSFTN GP09.phx.gbl...
"WHERE DE_change.load_ id = "n & Request.QuerySt ring("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*****@ielearn ing.com
http://www.ielearning.com
714.637.9480 x17
"Lisa" <pe*****@yahoo. com> wrote in message
news:89******** *************** ***@posting.goo gle.com...
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.BunNa me = "'" & Trim(Request.Fo rm("txtBUN")) & "', " & _
DE_change.Owner Name = "'" & Trim(Request.Fo rm("txtOwnerNam e")) & "', "
& _
DE_change.Manag er = "'" & Trim(Request.Fo rm("txtManager" )) & "', " & _
DE_change.CCM = "'" & Trim(Request.Fo rm("txtCCM")) & "', " & _
DE_change.LoadD ate = "'" & Trim(Request.Fo rm("txtLoadDate ")) & "', " &
_
DE_change.ProdD ate = "'" & Trim(Request.Fo rm("txtProdDate ")) & "', " &
_
DE_change.Submi ssionDate = "'" & Trim(Request.Fo rm("txtSubmitDa te")) &
"', " & _
WHERE DE_change.load_ id = Request.QuerySt ring("LoadID")"

cnConnection.Ex ecute(strSQL)

this is the error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Project2/Update_change.a sp, line 22, column 6
WHERE DE_change.load_ id = Request.QuerySt ring("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.goo gle.com...
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.Qu erystring("Load ID")) & "')"] - I'm at a loss as to
why I keep getting the error........co nfused?

~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.Fo rm("txtBUN")) & "', " & _
"OwnerName = '" & Trim(Request.Fo rm("txtOwnerNam e")) & "', " & _
"Manager = '" & Trim(Request.Fo rm("txtManager" )) & "', " & _
"CCM = '" & Trim(Request.Fo rm("txtCCM")) & "', " & _
"LoadDate ='" & Trim(Request.Fo rm("txtLoadDate ")) & "', " & _
"ProdDate ='" & Trim(Request.Fo rm("txtProdDate ")) & "', " & _
"Submission Date ='" & Trim(Request.Fo rm("txtSubmitDa te")) & "' " & _
"WHERE load_id = " & Request.QuerySt ring("LoadID")

cnConnection.Ex ecute(strSQL)

"Chris Barber" <ch***@blue-canoe.co.uk.NOS PAM> wrote in message news:<#P******* *******@tk2msft ngp13.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
3040
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 terminated. I have 2 databases that I DTS data out of and create a view for each. I'm trying to update from each view, but when I try the first update, I get the error. I have an insert-Into, select query that works fine this way. Help...
6
3255
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 by a form. I created an update query called qryUpdate, which has both tblCustomers and qrySelect (linked by CustomerID). And I try to update one of the fields in tblCustomers. If I open the form, and I click on a button, I can open qrySelect and...
10
3260
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 wouldn't work (nothing changed): UPDATE tblManuals SET tblManuals.PARTNUM = Trim(); Would someone please tell me how to do an update query that will trim the spaces?
4
11325
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 AddressDescription of Entity 456 = AddressDescription of Entity_ID 123 Address1 of Entity 456 = Address1 of Entity_ID 123 City of Entity 456 = City of Entity_ID 123
7
3524
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" Transactions = name of the table I want to update balance = name of the field i want to update daily balance= name of the query result that I want to move to the table
6
7892
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 as a select query it runs fine. The select query is as follows:
0
1282
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. but when i go to delete the record, it asks me if i want to run the update query, then stops and says;
2
12199
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 has no value in it. Query: Field: Zipcode Table: tblMemberInfo Update to: Replace(,"""","")
2
2720
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 then updates a record in an Access database. I get this when the page is displayed: Database Results Wizard Error The operation failed. If this continues, please contact your server administrator. I replaced the update query with a simple...
0
7946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8251
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8234
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6654
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5408
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3859
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.