Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 September 5th, 2003, 08:23 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 Identifier

Hi there

I've got this error in my code and am not sure how to correct it:

Microsoft VBScript compilation error '800a03f2'

Expected identifier

/st-sec_dev/secure/Footer/process_edit.asp, line 5


Here is my code:

    SQLUpdate = "UPDATE Footer SET Title = '" & replace(request.form("T"),"'","''") & "' , Detail = '" & replace(request.Form("D"), "'","''") & "' , Copyright = '" & replace(request.Form("C"), "'", "''") & "' WHERE FooterID = '" & request.Form("FooterID") & "'"

thanks in advance

Adam
 
Old September 5th, 2003, 08:46 AM
Authorized User
 
Join Date: Aug 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could be that SQLUpdate a reserved word is.

Try changing it to strSql:

Dim strSql

strSql = "UPDATE ....."

Set rs<your recordset> = db<your db>.execute(strSql)


if that is not the problem try removing the replace and see if it works. If that is the problem you can do the replacements before you create you statement thus leaving is out.

Hope this could help

Greetz

Tom.
 
Old September 5th, 2003, 08:47 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't see anything wrong with that statement. Are you sure that's line 5? And is that all on one line? Obviously it wrapped in the post, but I ask only because there are several spaces after the & after "Detail=". Not sure if that's from the wrap or if your code is split to a second line.

Peter
 
Old September 5th, 2003, 09:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

One other thing, the line numbers on these syntax related errors aren't always reliable. It could be something wrong with the preceding line(s).
 
Old September 5th, 2003, 10:09 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

It's funny because the code I've given is the code I've used elsewhere and it works fine.

Do you know what it means when the error message reads 'Expected Identifier' - I'm not sure what identifier it's looking for. I'm using SQL as my database - do you think it might be SQL related?

thanks Adam
 
Old September 5th, 2003, 04:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Adam,

Are you sure the code generates a valid SQL Statement? To check this out, use Response.Write(SQLUpdate) to send it to the browser.

Maybe Request.Form("FooterID") does not have a value, so your WHERE clause ends up as WHERE = ''

Are you sure that FooterID is text in the database? The ID makes it sound like a number, in which case you should drop the surrounding apostrophes for the FooterID in the WHERE clause.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 8th, 2003, 03:27 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

Fantastic - thanks Imar - worked a treat - it was the FooterID being an int rather than text - Stupid me.

Thanks

Adam





Similar Threads
Thread Thread Starter Forum Replies Last Post
"identifier> expected"error simmy_tj VB.NET 2002/2003 Basics 1 December 18th, 2006 08:31 AM
Identifier expected andriy JSP Basics 0 November 1st, 2006 11:28 PM
identifier expected errors ali582 Java Basics 3 September 2nd, 2006 09:10 PM
"Identifier expected" Error NehaJani VB.NET 2002/2003 Basics 6 January 23rd, 2006 11:27 PM
Identifier Expected syncmaster VB.NET 2002/2003 Basics 1 September 2nd, 2004 03:34 AM





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