NatuScape
03-15-2005, 03:45 PM
Hi all,
I'm using the following code to insert a record into a table, but I keep getting the following error: "Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement"
Here's the code:
conn1.Execute "INSERT INTO Scores (Site, Year, Quarter, Element, SubElement, Score) VALUES ('" & Request.Form("SiteToReport") & "'," & Request.Form("YearToReport") & "," & Request.Form("QuarterToReport") & ",'Hazard Assessments','Subelement 1: Hazard Assessments'," & Request.Form("HazardAssessments") & ")"
I've opened "conn1" as an ADODB connection as I've done a million times before, so I know that's not the problem. The query renders itself perfectly, here's what it renders:
INSERT INTO Scores (Site, Year, Quarter, Element, SubElement, Score) VALUES ('Bedford - Ashby Rd',2004,4,'Hazard Assessments','Subelement 1: Hazard Assessments',1)
As far as I can tell everything should be good to go into the table, but it doesn't.
What am I missing???? Thanks in advance!
Natalia :)
I'm using the following code to insert a record into a table, but I keep getting the following error: "Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement"
Here's the code:
conn1.Execute "INSERT INTO Scores (Site, Year, Quarter, Element, SubElement, Score) VALUES ('" & Request.Form("SiteToReport") & "'," & Request.Form("YearToReport") & "," & Request.Form("QuarterToReport") & ",'Hazard Assessments','Subelement 1: Hazard Assessments'," & Request.Form("HazardAssessments") & ")"
I've opened "conn1" as an ADODB connection as I've done a million times before, so I know that's not the problem. The query renders itself perfectly, here's what it renders:
INSERT INTO Scores (Site, Year, Quarter, Element, SubElement, Score) VALUES ('Bedford - Ashby Rd',2004,4,'Hazard Assessments','Subelement 1: Hazard Assessments',1)
As far as I can tell everything should be good to go into the table, but it doesn't.
What am I missing???? Thanks in advance!
Natalia :)