473,653 Members | 3,000 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 6385
"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
3043
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
3257
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
3261
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
11327
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
3527
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
7894
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
12203
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
2721
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
8283
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
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
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
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
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
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.