error with insertV.asp to database
<html dir="rtl">
<head>
</head>
<body bgcolor="yellow">
<%
fname = Request.Form ("fname")
lname = Request.Form ("lname")
byear = Request.Form ("byear")
address = Request.Form ("address")
email = Request.Form ("email")
phone = Request.Form ("pon2") & "-" & Request.Form ("pon1")
cphone = Request.Form ("cpon2") & "-" & Request.Form ("cpon1")
if (Request.Form ("toar")="true") then
toar=True
else
toar=False
end if
if (Request.Form ("exper")="true") then
exper=True
else
exper=False
end if
if (Request.Form ("hebrew")="true") then
hebrew=True
else
hebrew=False
end if
if (Request.Form ("english")="true") then
english=True
else
english=False
end if
if (Request.Form ("arabic")="true") then
arabic=True
else
arabic=False
end if
if (Request.Form ("france")="true") then
france=True
else
france=False
end if
if (Request.Form ("spanish")="true") then
spanish=True
else
spanish=False
end if
if (Request.Form ("rusion")="true") then
rusion=True
else
rusion=False
end if
if (Request.Form ("other")="true") then
other=True
else
other=False
end if
byear=CInt(byear)
Function fixQuotes(theString)
fixQuotes=Replace(theString, "'", "''")
End Function
fname =fixQuotes(fname)
lname =fixQuotes(lname)
byear =fixQuotes(byear)
address =fixQuotes(address)
email =fixQuotes(email)
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.MapPath("db\atar.mdb") & ";" & _
"Uid=admin;" & _
"Pwd=;"
mySQL = "SELECT * FROM reg WHERE (fname='" & fname & "' AND lname='" & lname & "' AND email='" & email & "' AND byear=" & byear & ")"
Set oRS = oConn.Execute (mySQL)
If oRS.EOF Then
mySQL = "INSERT INTO reg (fname, lname, byear, address, email, phone, cphone, toar, exper, hebrew, english, arabic, france, spanish, rusion, other) " &_
"VALUES (" &_
"'" & fname & "'" & ", " &_
"'" & lname & "'" & ", " &_
bYear & ", " &_
"'" & address & "'" & ", " &_
"'" & email & "'" & ", " &_
"'" & phone & "'" & ", " &_
"'" & cphone & "'" & ", " &_
toar & ", " &_
exper & ", " &_
hebrew & ", " &_
english & ", " &_
arabic & ", " &_
france & ", " &_
spanish & ", " &_
rusion & ", " &_
other &_
")"
oConn.Execute (mySQL) <--------The error is stated.
Response.Write "<h1 align='center'>úåãä ìê, ôøèéê ðøùîå áäöìçä </h1>"
Response.Write "<br />"
Else
Response.Write "<h1 align='center'> ëáø ðøùîú ëîúðãá áà úø, à ðå ðôðä à ìéê áîéãú äöåøê </h1>"
Response.Write "<br />"
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
%>
</body>
</html>
it returns:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/site/asp/insertV.asp, line 111
thanks for taking the time to read.
|