Click to See Complete Forum and Search --> : Microsoft JET Database Engine (0x80040E14)


chege
12-02-2008, 04:01 AM
Hi all am trying to save entries made by a user from html form to an ASP for but am getting an error as the conn.Execute sql,recaffected: Syntax error in INSERT INTO statement.
/assignment/Register.asp, line 38 line
is reached in the below code what could be the problem?kindly will appreciate.

<html>
<head><title>updating database</title></head>
<body>
<%
Dim filePath
dim Conn
dim birth
dim sql,connstring
dim recaffected

'filePath = Server.MapPath("MailAccounts.mdb")
connstring="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("MailAccounts.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Mode = 3
'Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath & ";Persist Security Info=False"
Conn.open(connstring)

birth=Request.Form("birthday")
birth=birth & "/" & Request.Form("Day")
birth=birth & "/" & Request.Form("Year")
sql="INSERT INTO [Accounts](yahooid,Password,FName,LName,Gender,DateofBirth,"
sql=sql & "country,Postalcode,AlternateMail,Securityquestion,Answer)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("password") & "',"
sql=sql & "'" & Request.Form("FName") & "',"
sql=sql & "'" & Request.Form("LName") & "',"
sql=sql & "'" & Request.Form("Gender") & "',"
sql=sql & "'" & birth & "',"
sql=sql & "'" & Request.Form("Country") & "',"
sql=sql & "'" & Request.Form("PostalCode") & "',"
sql=sql & "'" & Request.Form("altermail") & "',"
sql=sql & "'" & Request.Form("security") & "',"
sql=sql & "'" & Request.Form("Answer") & "')"
'on error resume next
response.write(sql)
conn.Execute sql,recaffected
'if err<>0 then
' Response.Write("No update permissions!")
'else
' Response.Write("<h3>" & recaffected & " record added</h3>")
'end if
conn.close
%>
</body>
</html>

jvanamali
12-03-2008, 04:12 PM
response.write(sql)

Can you copy paste the sql here and the exact error you are getting.

Might be issue with special characters such as ' in one of the text boxes.