|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
ASP/SQL UPDATE syntax error
The script I'm doing is simple enough - updating information in an MS Access database. The error message I'm getting is:
Microsoft JET Database Engine error '80040e14' Syntax error in UPDATE statement. [path]/edit_news_script.asp, line 53 The code is: Code:
51 Conn.Execute("UPDATE news SET title = '" + title_string + "' WHERE news_id = " + file);
52 Conn.Execute("UPDATE news SET body = '" + content_string + "' WHERE news_id = " + file);
53 Conn.Execute("UPDATE news SET update = '" + update_string + "' WHERE news_id = " + file);
Lines 51 and 52 are executing without trouble - 53 is the trouble line. I thought it might be something in the 'update_string' variable mucking things up, but I took it out, inserted normal text, and wound up with the same result. The database fields are all named correctly. I don't know if this is just so blazingly obvious that I'm overlooking it or what, so any help would be greatly appreciated. Cheers. |
|
#2
|
|||
|
|||
|
You're using javascript on the server it looks like.
In vbs I'd build the sql string into a variable before executing it, and then insert a response.write sqlvar before executing on the connection. This will show you the string in your browser (and show everyone else so don't do this on a live site!) |
|
#3
|
||||
|
||||
|
You're using "Update" as a field name, but it's a reserved word. Rename the field or wrap it in []. May I also suggest printing the VB variable "Update" and even the whole SQL Update command string instead of executing it, just to see if there are quotes or strange characters floating around in there... that's typically the problem.
-Dave |
|
#4
|
|||
|
|||
|
Quote:
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > ASP/SQL UPDATE syntax error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|