---
title: "Vad ar det jag missar?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/45680-vad-ar-det-jag-missar"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "annesophie"
published: "2002-06-12T10:14:32.000Z"
updated: "2002-06-12T11:32:55.000Z"
replies: 11
views: 296
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/45680-vad-ar-det-jag-missar"
---

# Vad ar det jag missar?

## #1 — annesophie, 2002-06-12T10:14Z

Jag far foljande felmeddelande pa "conn.execute(sql)" raden:

> Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 
> 
> \[Microsoft\]\[ODBC Microsoft Access Driver\] Syntax error in INSERT INTO statement. 
> 
> /evaluation/documents/evalcheck.asp, line 166

 

Sidan evalcheck.asp ser ut sa har:

```

<%
option explicit
response.buffer=true

dim conn
dim sql
dim rs

dim fname
dim lname
dim email
dim country

dim vicor1Qone
dim vicor1Qtwo
dim vicor1Qthree
dim vicor1Qfour

dim vicor2Qone
dim vicor2Qtwo
dim vicor2Qthree
dim vicor2Qfour

dim eos1Qone
dim eos1Qtwo
dim eos1Qthree
dim eos1Qfour

dim craftec1Qone
dim craftec1Qtwo
dim craftec1Qthree
dim craftec1Qfour

dim ault1Qone
dim ault1Qtwo
dim ault1Qthree
dim ault1Qfour

dim ault2Qone
dim ault2Qtwo
dim ault2Qthree
dim ault2Qfour

dim ault3Qone
dim ault3Qtwo
dim ault3Qthree
dim ault3Qfour

dim condor1Qone
dim condor1Qtwo
dim condor1Qthree
dim condor1Qfour

dim pbx1Qone
dim pbx1Qtwo
dim pbx1Qthree
dim pbx1Qfour

dim pbx2Qone
dim pbx2Qtwo
dim pbx2Qthree
dim pbx2Qfour

dim pbx3Qone
dim pbx3Qtwo
dim pbx3Qthree
dim pbx3Qfour
dim pbx3Qfive

dim pbx4Qone
dim pbxt4Qtwo
dim pbx4Qthree
dim pbx4Qfour

dim otherQone
dim otherQtwo

dim comments

fname=request.form("fname")
lname=request.form("lname")
email=request.form("email")
country=request.form("country")

vicor1Qone=request.form("vicor1Qone")
vicor1Qtwo=request.form("vicor1Qtwo")
vicor1Qthree=request.form("vicor1Qthree")
vicor1Qfour=request.form("vicor1Qfour")

vicor2Qone=request.form("vicor2Qone")
vicor2Qtwo=request.form("vicor2Qtwo")
vicor2Qthree=request.form("vicor2Qthree")
vicor2Qfour=request.form("vicor2Qfour")

eos1Qone=request.form("eos1Qone")
eos1Qtwo=request.form("eos1Qtwo")
eos1Qthree=request.form("eos1Qthree")
eos1Qfour=request.form("eos1Qfour")

craftec1Qone=request.form("craftec1Qone")
craftec1Qtwo=request.form("craftec1Qtwo")
craftec1Qthree=request.form("craftec1Qthree")
craftec1Qfour=request.form("craftec1Qfour")

ault1Qone=request.form("ault1Qone")
ault1Qtwo=request.form("ault1Qtwo")
ault1Qthree=request.form("ault1Qthree")
ault1Qfour=request.form("ault1Qfour")

ault2Qone=request.form("ault2Qone")
ault2Qtwo=request.form("ault2Qtwo")
ault2Qthree=request.form("ault2Qthree")
ault2Qfour=request.form("ault2Qfour")

ault3Qone=request.form("ault3Qone")
ault3Qtwo=request.form("ault3Qtwo")
ault3Qthree=request.form("ault3Qthree")
ault3Qfour=request.form("ault3Qfour")

condor1Qone=request.form("condor1Qone")
condor1Qtwo=request.form("condor1Qtwo")
condor1Qthree=request.form("condor1Qthree")
condor1Qfour=request.form("condor1Qfour")

pbx1Qone=request.form("pbx1Qone")
pbx1Qtwo=request.form("pbx1Qtwo")
pbx1Qthree=request.form("pbx1Qthree")
pbx1Qfour=request.form("pbx1Qfour")

pbx2Qone=request.form("pbx2Qone")
pbx2Qtwo=request.form("pbx2Qtwo")
pbx2Qthree=request.form("pbx2Qthree")
pbx2Qfour=request.form("pbx2Qfour")

pbx3Qone=request.form("pbx3Qone")
pbx3Qtwo=request.form("pbx3Qtwo")
pbx3Qthree=request.form("pbx3Qthree")
pbx3Qfour=request.form("pbx3Qfour")
pbx3Qfive=request.form("pbx3Qfive")

pbx4Qone=request.form("pbx4Qone")
pbxt4Qtwo=request.form("pbxt4Qtwo")
pbx4Qthree=request.form("pbx4Qthree")
pbx4Qfour=request.form("pbx4Qfour")

otherQone=request.form("otherQone")
otherQtwo=request.form("otherQtwo")

comments=request.form("comments")

%>

<!-- #INCLUDE FILE="koppling.asp" -->

<%

sql="INSERT INTO [eval] (fname, lname, email, country, vicor1Qone, vicor1Qtwo, vicor1Qthree, vicor1Qfour, vicor2Qone, vicor2Qtwo, vicor2Qthree, vicor2Qfour, eos1Qone, eos1Qtwo, eos1Qthree, eos1Qfour, craftec1Qone, craftec1Qtwo, craftec1Qthree, craftec1Qfour, ault1Qone, ault1Qtwo, ault1Qthree, ault1Qfour, ault2Qone, ault2Qtwo, ault2Qthree, ault2Qfour, ault3Qone, ault3Qtwo, ault3Qthree, ault3Qfour, condor1Qone, condor1Qtwo, condor1Qthree, condor1Qfour, pbx1Qone, pbx1Qtwo, pbx1Qthree, pbx1Qfour, pbx2Qone, pbx2Qtwo, pbx2Qthree, pbx2Qfour, pbx3Qone, pbx3Qtwo, pbx3Qthree, pbx3Qfour, pbx3Qfive, pbx4Qone, pbxt4Qtwo, pbx4Qthree, pbx4Qfour, otherQone, otherQtwo, comments) " &_
"VALUES ('"&fname&"','"&lname&"','"&email&"','"&country&"',"&vicor1Qone&","&vicor1Qtwo&","&vicor1Qthree&","&vicor1Qfour&","&vicor2Qone&","&vicor2Qtwo&","&vicor2Qthree&","&vicor2Qfour&","&eos1Qone&","&eos1Qtwo&","&eos1Qthree&","&eos1Qfour&","&craftec1Qone&","&craftec1Qtwo&","&craftec1Qthree&","&craftec1Qfour&","&ault1Qone&","&ault1Qtwo&","&ault1Qthree&","&ault1Qfour&","&ault2Qone&","&ault2Qtwo&","&ault2Qthree&","&ault2Qfour&","&ault3Qone&","&ault3Qtwo&","&ault3Qthree&","&ault3Qfour&","&condor1Qone&","&condor1Qtwo&","&condor1Qthree&","&condor1Qfour&","&pbx1Qone&","&pbx1Qtwo&","&pbx1Qthree&","&pbx1Qfour&","&pbx2Qone&","&pbx2Qtwo&","&pbx2Qthree&","&pbx2Qfour&","&pbx3Qone&","&pbx3Qtwo&","&pbx3Qthree&","&pbx3Qfour&","&pbx3Qfive&","&pbx4Qone&","&pbxt4Qtwo&","&pbx4Qthree&","&pbx4Qfour&","&otherQone&","&otherQtwo&",'"&comments&"');"
conn.execute(sql)
response.write sql

response.redirect("evaluation.html")
%>
```

Jag har dubbelkollat sa att alla falt stammer overens med vad som ska in..sa det ar inte det som ar fel. Jag kan inte skriva ut sql satsen, jJag har lagt in en check och den reagerar inte pa tomma falt alls sa jag tar for givet att det ar fel pa evalchecksidan nagonstans. Satte precis alla tabellfalt till not required som test i databasen men far fortfarande samma fel.

I min insert fick jag automatisk radbrytning da det var sa manga falt sa jag gjorde en "manuell" radbrytning precis innan VALUES...ar detta ratt?

Jag behover hjalp...please! 

/A

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

## #2 — hypatia, 2002-06-12T10:29Z

Jag är lite osäker på om du verkligen ska ha fnuttar i slutet och i början av raden samt det sista semikolonet. 
Borde det inte vara:

```
sql="INSERT INTO [eval] (fname, osv...) &_
VALUES (' " &fnamne& " ' osv) "
```

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

## #3 — annesophie, 2002-06-12T10:38Z

Jo det maste jag nog for annars far jag:

Microsoft VBScript compilation error '800a0409' 

Unterminated string constant 

/evaluation/documents/evalcheck.asp, line 164 

OBS! Jag kan inte se nagon text som ar satt mellan \['KOD\] taggar av nagon anledning sa undvik garna dom i denna traden.

HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELP!!!

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

## #4 — hypatia, 2002-06-12T10:43Z

Funkar det om du inte gör radbrytning alls då?

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

## #5 — LarsG, 2002-06-12T10:48Z

Kan du lägga till en utskift av variabeln sql och visa resultatet.

response.write sql

Det kanske är någon av dina strängar som innehåller en ' eller något. För att skydda sig mot sådant (även av säkerhetsskäl) så måste man lägga till att man byter alla förekomster av ' till '' i sql-statement.

fname=replace(request.form("fname"),"'","''")
'och så vidare med övriga variabler

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

## #6 — hypatia, 2002-06-12T10:48Z

Testa att göra så här i så fall:

sql = "INSERT INTO \[eval\]"
sql = sql & "(fname, osv...)"
sql = sql & "VALUES (' " &fnamne& " ' osv... )"

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

## #7 — annesophie, 2002-06-12T11:09Z

Om jag gor sa som Hypatia visar sa...

Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 

\[Microsoft\]\[ODBC Microsoft Access Driver\] Syntax error in INSERT INTO statement. 

/evaluation/documents/evalcheck.asp, line 95 

vilket ar: conn.execute(sql)

Sa har ser det ut nu:

\<%

sql = "INSERT INTO \[eval\]" 
sql = sql & "(fname, lname, email, country, vicor1Qone, vicor1Qtwo, vicor1Qthree, vicor1Qfour, vicor2Qone, vicor2Qtwo, vicor2Qthree, vicor2Qfour, eos1Qone, eos1Qtwo, eos1Qthree, eos1Qfour, craftec1Qone, craftec1Qtwo, craftec1Qthree, craftec1Qfour, ault1Qone, ault1Qtwo, ault1Qthree, ault1Qfour, ault2Qone, ault2Qtwo, ault2Qthree, ault2Qfour, ault3Qone, ault3Qtwo, ault3Qthree, ault3Qfour, condor1Qone, condor1Qtwo, condor1Qthree, condor1Qfour, pbx1Qone, pbx1Qtwo, pbx1Qthree, pbx1Qfour, pbx2Qone, pbx2Qtwo, pbx2Qthree, pbx2Qfour, pbx3Qone, pbx3Qtwo, pbx3Qthree, pbx3Qfour, pbx3Qfive, pbx4Qone, pbxt4Qtwo, pbx4Qthree, pbx4Qfour, otherQone, otherQtwo, comments)" 
sql = sql & "VALUES ('"& fname &"', '"&lname&"' , '"&email&"' , '"&country&"' , "&vicor1Qone&" , "&vicor1Qtwo&" , "&vicor1Qthree&" , "&vicor1Qfour&" , "&vicor2Qone&" , "&vicor2Qtwo&" , "&vicor2Qthree&" , "&vicor2Qfour&" , "&eos1Qone&" , "&eos1Qtwo&" , "&eos1Qthree&" , "&eos1Qfour&" , "&craftec1Qone&" , "&craftec1Qtwo&" , "&craftec1Qthree&" , "&craftec1Qfour&" , "&ault1Qone&" , "&ault1Qtwo&" , "&ault1Qthree&" , "&ault1Qfour&","&ault2Qone&","&ault2Qtwo&","&ault2Qthree&","&ault2Qfour&","&ault3Qone&","&ault3Qtwo&","&ault3Qthree&","&ault3Qfour&","&condor1Qone&","&condor1Qtwo&","&condor1Qthree&","&condor1Qfour&","&pbx1Qone&","&pbx1Qtwo&","&pbx1Qthree&","&pbx1Qfour&","&pbx2Qone&","&pbx2Qtwo&","&pbx2Qthree&","&pbx2Qfour&","&pbx3Qone&","&pbx3Qtwo&","&pbx3Qthree&","&pbx3Qfour&","&pbx3Qfive&","&pbx4Qone&","&pbxt4Qtwo&","&pbx4Qthree&","&pbx4Qfour&","&otherQone&","&otherQtwo&",'"&comments&"' )"

conn.execute(sql)
response.write sql

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

## #8 — annesophie, 2002-06-12T11:12Z

LarsG\>

INSERT INTO \[eval\](fname, lname, email, country, vicor1Qone, vicor1Qtwo, vicor1Qthree, vicor1Qfour, vicor2Qone, vicor2Qtwo, vicor2Qthree, vicor2Qfour, eos1Qone, eos1Qtwo, eos1Qthree, eos1Qfour, craftec1Qone, craftec1Qtwo, craftec1Qthree, craftec1Qfour, ault1Qone, ault1Qtwo, ault1Qthree, ault1Qfour, ault2Qone, ault2Qtwo, ault2Qthree, ault2Qfour, ault3Qone, ault3Qtwo, ault3Qthree, ault3Qfour, condor1Qone, condor1Qtwo, condor1Qthree, condor1Qfour, pbx1Qone, pbx1Qtwo, pbx1Qthree, pbx1Qfour, pbx2Qone, pbx2Qtwo, pbx2Qthree, pbx2Qfour, pbx3Qone, pbx3Qtwo, pbx3Qthree, pbx3Qfour, pbx3Qfive, pbx4Qone, pbxt4Qtwo, pbx4Qthree, pbx4Qfour, otherQone, otherQtwo, comments)VALUES ('dasd', 'dasd' , 'dasd@dsad.se' , 'Denmark' , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,,2,2,1,2,'dsada' ) 
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 

\[Microsoft\]\[ODBC Microsoft Access Driver\] Syntax error in INSERT INTO statement. 

/evaluation/documents/evalcheck.asp, line 94 

Hmmm ser ett tomt fat forresten!!!! Maste leta lite vad det kan vara...

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

## #9 — solbulle, 2002-06-12T11:16Z

Red. lite sen där...

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

## #10 — annesophie, 2002-06-12T11:19Z

Hmmm tror att jag har lost det...ett mellanslag hade tagit sig in i ett falt. 

Jag aterkommer!

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

## #11 — annesophie, 2002-06-12T11:32Z

Det funkade... :) Tack for hjalpen allihop! Skont att WF finns!

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

## #12 — Hoffe, 2002-06-12T11:32Z

Kör Trim(Request.Form("namn"))  så slipper du mellanslag före å efter strängens början

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/45680-vad-ar-det-jag-missar
