473,327 Members | 2,074 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,327 software developers and data experts.

Syntax error in UPDATE statement.

I don't think my code get to error;
please check the code for me
i have found but i can see where error was
this is my code UPDATE:
if trim(request("Option"))="EditCustomer" then
CustomerId = trim(request.form("CustomerId"))
strupdate="UPDATE customer SET CustomerId ='"&CustomerId&"',firstname='"&Firstname&"'"&","
strupdate=strupdate&"Lastname ='"&lastname&"',Gender='"&Gender&"'"&","
strupdate=strupdate&"email ='"&email&"',phone='"+phone+"'"&","
strupdate=strupdate&"nation ='"&nation&"',customertype ='"&customertype&"'"&","
strupdate=strupdate&"note='"&note&"',status='"&sta tuss&"'"
strupdate=strupdate&"WHERE CustomerId ='"+request.QueryString("CustomerId")+"';"

'response.Write(strupdate)
Set rs = Conn.execute(strupdate)---(error here)
Response.Redirect("ListCustomer.asp")
rs.Close
Set rs=nothing
end if
thanks
Regards
Hoang Phuc
Feb 27 '08 #1
1 1113
shweta123
692 Expert 512MB
Hi,

Try writing update query like this :
Expand|Select|Wrap|Line Numbers
  1.     strupdate="UPDATE customer SET CustomerId ='"&CustomerId&"',firstname="'&Firstname&'" "
  2. strupdate= strupdate & "Lastname ="'&lastname&'",Gender="'&Gender&'" "
  3. strupdate=strupdate & "email ="'&email&'",phone="' & phone &'" "
  4. strupdate=strupdate &"nation ="'&nation&'",customertype ="'&customertype&'" "
  5. strupdate=strupdate&"note="'&note&'",status="'&statuss&'" "
  6. strupdate=strupdate& " WHERE CustomerId = "'& request.QueryString("CustomerId")&'"; "
  7.  
  8. Set rs = Conn.execute(strupdate)
I don't think my code get to error;
please check the code for me
i have found but i can see where error was
this is my code UPDATE:
if trim(request("Option"))="EditCustomer" then
CustomerId = trim(request.form("CustomerId"))
strupdate="UPDATE customer SET CustomerId ='"&CustomerId&"',firstname='"&Firstname&"'"&","
strupdate=strupdate&"Lastname ='"&lastname&"',Gender='"&Gender&"'"&","
strupdate=strupdate&"email ='"&email&"',phone='"+phone+"'"&","
strupdate=strupdate&"nation ='"&nation&"',customertype ='"&customertype&"'"&","
strupdate=strupdate&"note='"&note&"',status='"&sta tuss&"'"
strupdate=strupdate&"WHERE CustomerId ='"+request.QueryString("CustomerId")+"';"

'response.Write(strupdate)
Set rs = Conn.execute(strupdate)---(error here)
Response.Redirect("ListCustomer.asp")
rs.Close
Set rs=nothing
end if
thanks
Regards
Hoang Phuc
Feb 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robert Mark Bram | last post by:
Hi All! I have the following two methods in an asp/jscript page - my problem is that without the update statement there is no error, but with the update statement I get the following error: ...
7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
5
by: S.Patten | last post by:
Hi, I have a problem with updating a datetime column, When I try to change the Column from VB I get "Incorrect syntax near '942'" returned from '942' is the unique key column value ...
4
by: Bob Stearns | last post by:
The statement: merge into nullid.animals_et_in t1 using is3.animals t2 on t1.sire_assoc=t2.assoc and t1.sire_prefix=t2.prefix and t1.sire_regnum=t2.regnum when matched then update set...
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...
1
by: amitbadgi | last post by:
HI i am getting the foll error while conv an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Syntax error in UPDATE statement. Source Error: Line...
6
by: FayeC | last post by:
I really need help figuring this out. i have a db with mostly text fields but 2. The user_id field is an autonumber (key) and the user_newsletter is a number (1 and 0) field meaning 1 yes the ...
8
by: Stephen Plotnick | last post by:
I have three forms and update one table in an Access DB with sucess in one form. In the other two forms I'm trying to do an update to a different table in the Access DB. The error I'm getting...
1
by: ajos | last post by:
hi evrybdy, the problem is:- i had this running before in jsp but when i changed the jsp page using struts tags there occoured a problem... when i enter values in the 2 text boxes and click enter...
3
by: phobia1 | last post by:
Hi once again. We have just changed our ISP and things that worked fine now do not, Obviously its in the differences of MYSQL and PHP versions. Have fixed most of the problems but this UPDATE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.