Problemer med insert into sætning
Hej,jeg har følgende kode:
<%
Session.LCID = 1030
pagePath = Server.MapPath(\"./\")
Set myConn = Server.CreateObject(\"ADODB.Connection\")
myConn.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=F:\\home\\rnndk\\scripts\\databasen\\mobil.mdb\"
fornavn = Request.Form(\"fornavn\")
efternavn = Request.Form(\"efternavn\")
adresse = Request.Form(\"adresse\")
postnr = Request.Form(\"postnr\")
by = Request.Form(\"by\")
email = Request.Form(\"email\")
mobil = Request.Form(\"mobil\")
password = Request.Form(\"password\")
nyhedergenerelt = Request.Form(\"nyhedergenerelt\")
valget2001 = Request.Form(\"valget2001\")
sportgenerelt = Request.Form(\"sportgenerelt\")
sportishockey = Request.Form(\"sportishockey\")
sporthandbold = Request.Form(\"sporthandbold\")
sportfodbold = Request.Form(\"sportfodbold\")
sportandet = Request.Form(\"sportandet\")
politik = Request.Form(\"politik\")
kommunalt = Request.Form(\"kommunalt\")
kultur = Request.Form(\"kultur\")
konkurrence = Request.Form(\"konkurrence\")
response.write(\"1: [\" & fornavn & \"]\")
response.write(\"2: [\" & efternavn & \"]\")
response.write(\"3: [\" & adresse & \"]\")
response.write(\"4: [\" & postnr & \"]\")
response.write(\"5: [\" & by & \"]\")
response.write(\"6: [\" & email & \"]\")
response.write(\"7: [\" & mobil & \"]\")
response.write(\"8: [\" & password & \"]\")
response.write(\"9: [\" & nyhedergenerelt & \"]\")
response.write(\"10: [\" & valget2001 & \"]\")
response.write(\"11: [\" & sportgenerelt & \"]\")
response.write(\"12: [\" & sportishockey & \"]\")
response.write(\"13: [\" & sporthandbold & \"]\")
response.write(\"14: [\" & sportfodbold & \"]\")
response.write(\"15: [\" & sportandet & \"]\")
response.write(\"16: [\" & politik & \"]\")
response.write(\"17: [\" & kommunalt & \"]\")
response.write(\"18: [\" & kultur & \"]\")
response.write(\"19: [\" & konkurrence & \"]\")
strSQL = \"INSERT INTO Indhold (fornavn, efternavn, adresse, postnr, by, email, mobil, password, nyhedergenerelt, valget2001, sportgenerelt, sportishockey, sporthandbold, sportfodbold, sportandet, politik, kommunalt, kultur, konkurrence) VALUES (\'\" & fornavn & \"\', \'\" & efternavn & \"\', \'\" & adresse & \"\', \'\" & postnr & \"\', \'\" & by & \"\', \'\" & email & \"\', \'\" & mobil & \"\', \'\" & password & \"\', \'\" & nyhedergenerelt & \"\', \'\" & valget2001 & \"\', \'\" & sportgenerelt & \"\', \'\" & sportishockey & \"\', \'\" & sporthandbold & \"\', \'\" & sportfodbold & \"\', \'\" & sportandet & \"\', \'\" & politik & \"\', \'\" & kommunalt & \"\', \'\" & kultur & \"\', \'\" & konkurrence & \"\')\"
Set rs = myConn.Execute(strSQL)
myConn.Close
Set myConn = Nothing
%>
Og får følgende fejl:
1: [Morten]2: [Lindegaard]3: [Rødovre Parkvej 257stth]4: [2610]5: [Rødovre]6: [morten@rnn.dk]7: [21433323]8: [topper]9: [Ja]10: [Ja]11: [Ja]12: [Ja]13: [Ja]14: [Ja]15: [Ja]16: [Ja]17: [Ja]18: [Ja]19: [Ja]
Microsoft OLE DB Provider for ODBC Drivers error \'80040e14\'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/home/edit-sms.asp, line 57