---
title: "Typblandningsfel..."
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/78497-typblandningsfel"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Havregryn"
published: "2003-05-30T17:03:49.000Z"
updated: "2003-05-31T19:32:11.000Z"
replies: 6
views: 233
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/78497-typblandningsfel"
---

# Typblandningsfel...

## #1 — Havregryn, 2003-05-30T17:03Z

Sökte i forumet och hittade ett gammal inlägg med samma rubrik, dock inte samma fel. Så jag skriver en ny tråd.
Får felet typblandningsfel i villkorsuttryck.

Con.Execute("Select \* FROM alt")
alternative = Request.Form("alternative")
total = Request.Form("total")
Con.Execute("UPDATE alt SET alternative = '"& alternative &"', total = '"& total &"' where PollID = "& Request.Form("redID") &"")

Con.Execute("Select \* FROM poll")
question = Request.Form("question")
totalvotes = Request.Form("totalvotes")
Con.Execute("UPDATE poll SET question = '"& question &"', totalvotes = '"& totalvotes &"' where PollID = "& Request.Form("redID") &"")

Någonstans här ligger ett fel begravt. Tacksam om någon vet var.

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

## #2 — @nders, 2003-05-30T17:05Z

I SQL-frågor ska man ha apostrofer runt textvärden men inte runt talvärden. Om alternative eller total är av taltyp, släng bort apostroferna.

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

## #3 — Havregryn, 2003-05-30T17:10Z

Skall testa.
Tack.

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

## #4 — Havregryn, 2003-05-30T17:29Z

Fasiken...
Samma fel. Jag gjorde följande eftersom total och totalvotes är tal:

Con.Execute("Select \* FROM alt")
alternative = Request.Form("alternative")
total = Request.Form("total")
Con.Execute("UPDATE alt SET alternative = '"& alternative &"', total = '& total &' where PollID = "& Request.Form("redID") &"")

Con.Execute("Select \* FROM poll")
question = Request.Form("question")
totalvotes = Request.Form("totalvotes")
Con.Execute("UPDATE poll SET question = '"& question &"', totalvotes = '& totalvotes &' where PollID = "& Request.Form("redID") &"")
Response.redirect "inloggad.asp"

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

## #5 — Jesper T, 2003-05-30T17:46Z

Nej, nej, du skall inte ta bort dubbelfnuttarna("). 
Du skall ta bort enkelfnuttarna (').

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

## #6 — Jesper T, 2003-05-30T17:46Z

V.v använd \[kod\]-taggarna.

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

## #7 — Sky, 2003-05-31T19:32Z

börja med första frågan sedan om den funkar tar du andra..

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/78497-typblandningsfel
