Du har blandat ihop syntaxen för update och insert.
update t set c1 = 4711, c2 = 'MC' where pk = 12
är ett exempel på gilitig update-sats.
Flyttas från Mysql
2 svar · 209 visningar · startad av WebbisNet
Set conn = Server.CreateObject("ADODB.connection")
conn.Open connstr
tblstart = Request.Form("txtstart")
tblTopRight = Request.Form("txtTopRight")
tblBottom = Request.Form("txtBottom")
SQL="UPDATE Mainsite SET tblStart='txtStart, tblTopRight='txtTopRight', tblBottom='txtBottom'"
SQL = SQL & "(tblStart, tblTopRight, tblBottom)"
SQL = SQL & "VALUES(' " & txtStart & " ',' " & txtTopRight & " ',' " & txtBottom & " ')"
Conn.Execute(SQL)
Response.Redirect "../main.asp"
Vad är det som gör att koden funkar
Felet jag får är:
ADODB.Connection.1 error '80004005'
SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near 'txtTopRight', tblBottom='txtBottom'(tblStart, tblTopRight, tblBottom)VALUES(' '' at line 1
/asp/Admin/db-conn/update-start.asp, line 12
Du har blandat ihop syntaxen för update och insert.
update t set c1 = 4711, c2 = 'MC' where pk = 12
är ett exempel på gilitig update-sats.
Flyttas från Mysql
samt missat en ' på efter 'txtStart,