Der er en syntaksfejl i INSERT INTO-sætningen.
Jeg har tidligere set et indlæg af netsrac\'s omkring problemet Microsoft JET Database Engine fejl \'80040e14\'Der er en syntaksfejl i INSERT INTO-sætningen.
/litt/personal/form_ac_litt.asp, linje 53
Jeg har prøvet at kigge det grundig igennem, men kan ikke se fejlen - kender nogen en liste over reserverede navne?
Jeg har følgende script
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<%
\' Declaring variables
Dim business, wireless, history, gender, online, education, health, statistics, art, author, title, year, publisher, magi, oth, con, sql_insert
\' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = \"\" Then string = \" \"
ChkString = Replace(string, \"\'\", \"\'\'\")
End Function
\' Receiving values from Form
business=Request.Form(\"business\")
wireless=Request.Form(\"wireless\")
history=Request.Form(\"history\")
gender=Request.Form(\"gender\")
online=Request.Form(\"online\")
education=Request.Form(\"education\")
health=Request.Form(\"health\")
statistics=Request.Form(\"statistics\")
author = ChkString(Request.Form(\"author\"))
title = ChkString(Request.Form(\"title\"))
year = ChkString(Request.Form(\"year\"))
publisher = ChkString(Request.Form(\"publisher\"))
magi = ChkString(Request.Form(\"magi\"))
oth = ChkString(Request.Form(\"oth\"))
data_source = \"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\" & _
Server.MapPath(\"game-research-ref.mdb\")
sql_insert = \"insert into users (business, wireless, history, gender, online, education, health, statistics, art, author, title, year, publisher, magi, oth) values (\'\" & _
business & \"\', \'\" & wireless & \"\', \'\" & history & \"\',\'\" & gender & \"\',\'\" & online & \"\',\'\" & education & \"\',\'\" & health & \"\',\'\" & statistics & \"\',\'\" & art & \"\',\'\" & author & \"\',\'\" & title & \"\', \'\" & year & \"\',\'\" & publisher & \"\', \'\" & magi & \"\',\'\" & oth & \"\')\"
\' Creating Connection Object and opening the database
Set con = Server.CreateObject(\"ADODB.Connection\")
con.Open data_source
con.Execute sql_insert
\' Done. Close the connection
con.Close
Set con = Nothing
%>
Your link have been submittet
</body>
</html>
