|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Basic Update
Hi there,
I am very new to ASP and are using Dreamweaver to write my code. However I have a complicated update page so I am going to hand code it. I started by breaking down to the basics of Updating but I keep getting a 'Syntax error in UPDATE statement' error. Can anybody see where I am going wrong?: <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../Connections/Publishing.asp" --> <% If Request("Submit") <> "" Then %> <% set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = MM_Publishing_STRING Command1.CommandText = "UPDATE Test SET Value = Paul WHERE ID = 2 " Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute() %> <% End If %> Thanks again |
|
#2
|
||||
|
||||
|
"UPDATE Test SET Value = 'Paul' WHERE ID = 2"
|
|
#3
|
|||
|
|||
|
Thanks Karsh but it was because I called a field name in my database 'Value'.
As soon as I changed that it worked. But thanks anyway |
|
#4
|
|||
|
|||
|
ewwww, this sounds like access
if you're wondering why it didn't work, value is a reserverd word in TSQL. Even though you CAN use them in schema definition, it's highly recommended you don't. You could just use [value] to refer to the column and that would work instead of having to rename the column and having to deal with changes in code elsewhere, but like i sad, it's bad programming practice to use TSQL words in schema definition. |
|
#5
|
||||
|
||||
|
Oops, missed that one. Guess I'm not perfect after all
. Glad you found the answer in spite of me ![]() |
|
#6
|
|||
|
|||
|
nah, you found the first error, he's using access
![]() I only say that because i can't say i've used any other DBMS that's allowed Paul to be entered rather than 'Paul'. But regaurdless, it's good programming practice and CERTAINLY SQL stardard to do 'Paul' (except for dates which require # but once again.. that's access......) |
|
#7
|
|||
|
|||
|
what the? moderator karsh?
|
|
#8
|
||||
|
||||
|
Yeah, moderating the new hardware forums. Better be nice to me
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Basic Update |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|