arendt73
asked on
Error updating records on ASP submission page
I have an ASP submission page that updates the same three records every few months. I get the following error after making a submission into an Access database.
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/warrant/date_thankyou.asp , line 6
Here is the code:
Any assistance with Update code is greatly appreciated. Thank you.
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/warrant/date_thankyou.asp
Here is the code:
<%
strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("\warrant\db\hearingdates.mdb") & ""
set conn = server.createobject("adodb.connection")
conn.open strconn
strSQLI = "UPDATE hearingdates(date_1, date_2, date_3) values ('"& request.Form("date_1") &"', '"& request.Form("date_2") &"', '"& request.Form("date_3") &"')"
conn.execute(strSQLI)
%>
Any assistance with Update code is greatly appreciated. Thank you.
ASKER
I updated the code with the recommendation and got the following error:
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/warrant/date_thankyou.asp , line 6
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/warrant/date_thankyou.asp
Please post your updated code
ASKER
As requested, please see below. Thank you.
<%
strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("\warrant\db\hearingdates.mdb") & ""
set conn = server.createobject("adodb.connection")
conn.open strconn
strSQLI = "UPDATE hearingdates set date_1 = '"& request.Form("date_1") &"', date_2 = '"& request.Form("date_2") &"', date_3 = '"& request.Form("date_3") & "'"
conn.execute(strSQLI)
%>
what data type are fields date_1, date_2, and date_3? if they are strings, and there is no values being passed into it, then you should enter in a NULL value. if it's a datetime field, I'd have to look into it more.
I guess first thing to check is to verify whether or not any data is coming over. You can do that by doing a Response.Write on your sql variable after you build it.
I guess first thing to check is to verify whether or not any data is coming over. You can do that by doing a Response.Write on your sql variable after you build it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
strSQLI = "UPDATE hearingdates set date_1 = '"& request.Form("date_1") &"', date_2 = '"& request.Form("date_2") &"', date_3 = '"& request.Form("date_3") & "'"