---
title: "Updateproblem"
type: "forum-thread"
url: "https://www.webforum.nu/amne/databaser-sql/97734-updateproblem"
topic: "Databaser & SQL"
topic_url: "https://www.webforum.nu/amne/databaser-sql"
author: "WebbisNet"
published: "2004-02-19T16:22:25.000Z"
updated: "2004-02-20T23:45:18.000Z"
replies: 2
views: 209
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/databaser-sql/97734-updateproblem"
---

# Updateproblem

## #1 — WebbisNet, 2004-02-19T16:22Z

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

Permalänk: https://www.webforum.nu/p/97734

## #2 — LarsG, 2004-02-19T16:25Z

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

Permalänk: https://www.webforum.nu/p/1280103

## #3 — lazat, 2004-02-20T23:45Z

samt missat en ' på efter 'txtStart,

Permalänk: https://www.webforum.nu/p/1280902

---

Tråden på webben: https://www.webforum.nu/amne/databaser-sql/97734-updateproblem
