---
title: "Syntax fel"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/9672-syntax-fel"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "aleborg"
published: "2001-05-22T20:29:00.000Z"
updated: "2001-05-22T21:13:00.000Z"
replies: 5
views: 197
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/asp/9672-syntax-fel"
---

# Syntax fel

## #1 — aleborg, 2001-05-22T20:29Z

Kan inte hitta felet, är jag blind eller?
Syntaxfel i INSERT INTO-uttryck. 

```
SQL = "Insert Into Design"
SQL = SQL & "(Title, Description, Keywords, InHead, Body, Bgcolor, Background, Text, Link, Vlink, Alink, Leftmargin, Topmargin, Marginwidth, Marginheight, TableWidth, TableBorder, TableSpacing, TablePadding, Head, Foot, Designname)"
SQL = SQL & "VALUES('"& Session("Title") &"', '"& Session("Description") &"', '"& Session("Keywords") &"', '"& Session("InHead") &"', '"& Session("Body") &"', '"& Session("Bgcolor") &"', '"& Session("Background") &"', '"& Session("Text") &"', '"& Session("Link") &"', '"& Session("Vlink") &"', '"& Session("Alink") &"', '"& Session("Leftmargin") &"', '"& Session("Topmargin") &"', '"& Session("Marginwidth") &"', '"& Session("Marginheight") &"', '"& Session("TableWidth") &"', '"& Session("TableBorder") &"', '"& Session("TableSpacing") &"', '"& Session("TablePadding") &"', '"& Session("Head") &"', '"& Session("Foot") &"', '"& Session("Designname") &"')"
Conn.Execute(SQL)
```

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

## #2 — Vide, 2001-05-22T20:32Z

Testa att skriva ut SQLsträngen innan du exekverar den... det blir lättare att se vad som är fel då:

```
SQL = "Insert Into Design"
SQL = SQL & "(Title, Description, Keywords, InHead, Body, Bgcolor, Background, Text, Link, Vlink, Alink, Leftmargin, Topmargin, Marginwidth, Marginheight, TableWidth, TableBorder, TableSpacing, TablePadding, Head, Foot, Designname)"
SQL = SQL & "VALUES('"& Session("Title") &"', '"& Session("Description") &"', '"& Session("Keywords") &"', '"& Session("InHead") &"', '"& Session("Body") &"', '"& Session("Bgcolor") &"', '"& Session("Background") &"', '"& Session("Text") &"', '"& Session("Link") &"', '"& Session("Vlink") &"', '"& Session("Alink") &"', '"& Session("Leftmargin") &"', '"& Session("Topmargin") &"', '"& Session("Marginwidth") &"', '"& Session("Marginheight") &"', '"& Session("TableWidth") &"', '"& Session("TableBorder") &"', '"& Session("TableSpacing") &"', '"& Session("TablePadding") &"', '"& Session("Head") &"', '"& Session("Foot") &"', '"& Session("Designname") &"')"
Response.Write SQL
Conn.Execute(SQL)
```

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

## #3 — emission, 2001-05-22T20:34Z

SQL & " (

glöm inte mellanrummen

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

## #4 — aleborg, 2001-05-22T20:49Z

```
Insert Into Design (Title, Description, Keywords, InHead, Body, Bgcolor, Background, Text, Link, Vlink, Alink, Leftmargin, Topmargin, Marginwidth, Marginheight, TableWidth, TableBorder, TableSpacing, TablePadding, Head, Foot, Designname) VALUES ('Web', 'lösningar!', 'web', 'javascript ', 'testÖvrigt ', '#FFFFFF', 'Bakgrundsbild', '#000000', '#006699', '#0000ff', '#0000ff', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'Head:', 'foot', 'test')
```

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

## #5 — LarsG, 2001-05-22T20:55Z

Text är ett reserverat ord i många SQL-dialekter, så du kanske skulle byta namn eller så. 

Om du använder Access eller SQL server så kan du ange namnet inom \[\].

Om du använder en ANSI kompatibel DBMS så kan du ange namnet inom ""

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

## #6 — aleborg, 2001-05-22T21:13Z

Tack, glömde det :)

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/9672-syntax-fel
