 |
| 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
|
|
|
|

September 5th, 2003, 08:23 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

September 5th, 2003, 08:46 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

September 5th, 2003, 08:47 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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
|
|

September 5th, 2003, 09:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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).
|
|

September 5th, 2003, 10:09 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

September 5th, 2003, 04:40 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

September 8th, 2003, 03:27 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Fantastic - thanks Imar - worked a treat - it was the FooterID being an int rather than text - Stupid me.
Thanks
Adam
|
|
 |