I am unable to spot the error in this query:
<% Dim strConnection, strQuery, Title, StartDate, EndDate, StartTime, EndTime, Address1, Address2, City, State, Website, Info
if Request.Form("evTitle" <> "" then Title = chr(39) & Request.Form("evTitle" & chr(39) else Title = null end if
if Request.Form("evStartDate" <> "" then StartDate = chr(35) & Request.Form("evStartDate" & chr(35) else StartDate = null end if
if Request.Form("evEndDate" <> "" then EndDate = chr(35) & Request.Form("evEndDate" & chr(35) else EndDate = null end if
if Request.Form("evStartTime" <> "" then StartTime = chr(35) & Request.Form("evStartTime" & chr(35) else StartTime = null end if
if Request.Form("evEndTime" <> "" then EndTime = chr(35) & Request.Form("evEndTime" & chr(35) else EndTime = null end if
if Request.Form("evAddress1" <> "" then Address1 = chr(39) & Request.Form("evAddress1" & chr(39) else Address1 = null end if
if Request.Form("evAddress2" <> "" then Address2 = chr(39) & Request.Form("evAddress2" & chr(39) else Address2 = null end if
if Request.Form("evCity" <> "" then City = chr(39) & Request.Form("evCity" & chr(39) else City = null end if
if Request.Form("evState" <> "" then State = chr(39) & Request.Form("evState" & chr(39) else State = null end if
if Request.Form("evWebsite" <> "" then Website = chr(39) & Request.Form("evWebsite" & chr(39) else Website = null end if
if Request.Form("evInfo" <> "" then Info = chr(39) & Request.Form("evInfo" & chr(39) else Info = null end if
set con = server.createObject("ADODB.Connection"
con.open ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("\db\umfa.mdb" & ";" & _
"Persist Security Info=False"
strQuery = "INSERT INTO events (evActive_Ind, evTitle) VALUES ('N'," & Title & ""
con.Execute(strQuery)
%>
it produces one of 2 errors:
with the variable:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/test/events/add-event-end.asp, line 22
with a string replacing the variable:
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.
/test/events/add-event-end.asp, line 22
Any help would be appreciated.
Kristen
<% Dim strConnection, strQuery, Title, StartDate, EndDate, StartTime, EndTime, Address1, Address2, City, State, Website, Info
if Request.Form("evTitle" <> "" then Title = chr(39) & Request.Form("evTitle" & chr(39) else Title = null end if
if Request.Form("evStartDate" <> "" then StartDate = chr(35) & Request.Form("evStartDate" & chr(35) else StartDate = null end if
if Request.Form("evEndDate" <> "" then EndDate = chr(35) & Request.Form("evEndDate" & chr(35) else EndDate = null end if
if Request.Form("evStartTime" <> "" then StartTime = chr(35) & Request.Form("evStartTime" & chr(35) else StartTime = null end if
if Request.Form("evEndTime" <> "" then EndTime = chr(35) & Request.Form("evEndTime" & chr(35) else EndTime = null end if
if Request.Form("evAddress1" <> "" then Address1 = chr(39) & Request.Form("evAddress1" & chr(39) else Address1 = null end if
if Request.Form("evAddress2" <> "" then Address2 = chr(39) & Request.Form("evAddress2" & chr(39) else Address2 = null end if
if Request.Form("evCity" <> "" then City = chr(39) & Request.Form("evCity" & chr(39) else City = null end if
if Request.Form("evState" <> "" then State = chr(39) & Request.Form("evState" & chr(39) else State = null end if
if Request.Form("evWebsite" <> "" then Website = chr(39) & Request.Form("evWebsite" & chr(39) else Website = null end if
if Request.Form("evInfo" <> "" then Info = chr(39) & Request.Form("evInfo" & chr(39) else Info = null end if
set con = server.createObject("ADODB.Connection"
con.open ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("\db\umfa.mdb" & ";" & _
"Persist Security Info=False"
strQuery = "INSERT INTO events (evActive_Ind, evTitle) VALUES ('N'," & Title & ""
con.Execute(strQuery)
%>
it produces one of 2 errors:
with the variable:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/test/events/add-event-end.asp, line 22
with a string replacing the variable:
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.
/test/events/add-event-end.asp, line 22
Any help would be appreciated.
Kristen