 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 31st, 2004, 07:49 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
expected end of statement
Hi there
I'm trying to update a table in my SQL Server database but I get an
expected end of statement with this following UPDATE statement and I can't see where. Any help much appreciated.
SQLUpdate = "UPDATE ViaDetails SET Title = '" & replace(request.form("N"),"'","''") & "' , Detail = '" & replace(request.Form("A"), "'","''") & "' , Telephone = '" & replace(request.Form("T"), "'","''") & "' , Fax = "& replace(request.Form("F"), "'","''") & "' , UserID = " & replace.request.Form("EU"), "'","''") & "' , Email = " & replace(request.Form("E"),"'","''") & "'"
thanks
Adam
|
|

December 31st, 2004, 01:33 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Write a debug script that will display the value of your variable "SQLUpdate". Seeing the actual sql command makes it much easier to debug rather than counting and matching single and double quotes. If you're still not able to see the problem, post the value of your sqlupdate variable here.
|
|

January 1st, 2005, 03:37 PM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Assuming that Fax UserID and Email are string fields you are missing a single quote on each of these at the start of the value.
This
Fax = "& replace(request.Form("F"), "'","''") & "' , UserID = " & replace.request.Form("EU"), "'","''") & "' , Email = " & replace(request.Form("E"),"'","''") & "'"
should be (Notice the single quote added in front of the values for Fax, UserID and Email)
Fax = '"& replace(request.Form("F"), "'","''") & "' , UserID = '" & replace.request.Form("EU"), "'","''") & "' , Email = '" & replace(request.Form("E"),"'","''") & "'"
I hope this helps. If Fax, UserID and Email are not strings (why I would not know) then you need to remove the single quotes.
|
|

January 4th, 2005, 05:37 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
got it - thanks guys - the systematic approach like you said worked
|
|
 |