Hi guys ive been working on an asp page to enter data into a database. I've spent the whole morning troubleshooting one error after another but I have an error, which i just cant find a resolution for.
Here is the asp code and the error im getting is:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
The line that the is specified in the error is the blank line inbetween the highlighted code.
can anyone help?
Thanks
Here is the asp code and the error im getting is:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
The line that the is specified in the error is the blank line inbetween the highlighted code.
Code:
<%
dim Customer, Member_id, S_name, F_name, Address_line1, Address_line2, Address_line3, City, Postcode, Contact_number, Date_of_birth, Date_registered
Dim objConnection
Dim objRecordset
Set objConnection= Server.CreateObject("ADODB.Connection")
Set objRecordset= Server.CreateObject("ADODB.Recordset")
objConnection.Provider="Microsoft.Jet.OLEDB.4.0"
objConnection.Open "c:\sites\content\j\c\s\jcs1987\db\The Picture House.mdb"
objRecordset.open "Customer", objConnection
sql="INSERT INTO " & Customer & " (" & Member_id & "," & S_name & "," & F_name & "," & Address_line1 & "," & Address_line2 & ", " & Address_line3 & "," & City & "," & Postcode & "," & Contact_number & "," & Date_of_birth & "," & Date_registered & ")"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("memberid") & "',"
sql=sql & "'" & Request.Form("surname") & "',"
sql=sql & "'" & Request.Form("firstname") & "',"
sql=sql & "'" & Request.Form("address1") & "',"
sql=sql & "'" & Request.Form("address2") & "',"
sql=sql & "'" & Request.Form("address3") & "',"
sql=sql & "'" & Request.Form("city") & "',"
sql=sql & "'" & Request.Form("postcode") & "',"
sql=sql & "'" & Request.Form("contactnumber") & "',"
sql=sql & "'" & Request.Form(#"dateofbirth"#) & "',"
sql=sql & "'" & Request.Form(#"dateregistered"#) & "',"
[COLOR="Red"]Set objRecordset=objConnection.Execute(sql)
If memberid<>"" Then[/COLOR]
Response.Write ("Member added")
end if
objRecordset=nothing
objConnection.close
%>
can anyone help?
Thanks