Wrox Programmer Forums
|
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
 
Old December 31st, 2004, 07:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default 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

 
Old December 31st, 2004, 01:33 PM
Registered User
 
Join Date: Dec 2004
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.

 
Old January 1st, 2005, 03:37 PM
Authorized User
 
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.



 
Old January 4th, 2005, 05:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

got it - thanks guys - the systematic approach like you said worked






Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Expected end of statement crabjoe Classic ASP Basics 3 December 4th, 2007 12:52 AM
Expected end islandtiu BOOK: Beginning ASP 3.0 5 January 17th, 2006 10:19 AM
Expected statement jonnyfive Classic ASP Basics 3 January 4th, 2006 07:04 PM
(0x800A03F6) Expected 'End' walrus Classic ASP Databases 5 April 15th, 2004 04:10 AM
expected end of statement....help.... chaoz83 Classic ASP Databases 3 September 23rd, 2003 01:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.