Hi,
I'm getting the following error in my asp code and i'm not sure how to fix it.
Microsoft OLE DB Provider for SQL Server error '80040e2f'
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Validation_Staff'. The conflict occurred in database 'TrainingEvaluation', table 'Staff', column 'StaffNo'.
/Evaluation/you-result.asp, line 29
The code I have at the moment is:
<%
Dim strSQL, objRS, strStaffNo, strCoursekey, strCourseDate, strtrainer, strQ1, strQ2, strQ3, strQ4, strQ5, strOther
strStaffNo = Request.QueryString("StaffNo")
strCoursekey = Request.QueryString("CourseKey")
strCourseDate = Request.QueryString("Trainer")
strTrainer = Request.QueryString("CourseDate")
strQ1 = Request.QueryString("Q1")
strQ2 = Request.QueryString("Q2")
strQ3 = Request.QueryString("Q3")
strQ4 = Request.QueryString("Q4")
strQ5 = Request.QueryString("Q5")
strOther = Request.QueryString("Other")
strSQL = "Insert into Validation (StaffNo, CourseKey, TrainerNo, CourseDate, ValidationQ1, ValidationQ2, ValidationQ3, ValidationQ3a, ValidationQ4, ValidationQ5) values ('" & strStaffNo & "'" &_
", '" & strCourseKey & "', '" & strTrainer & "', '" & strCourseDate & "', '" & strQ1 & "', '" & strQ2 & "'" &_
", '" & strQ3 & "', '" & strQ4 & "', '" & strQ5 & "', '" & strOther & "') "
Response.Write "Thank you for completing this course feedback form."
GetConnection
Set objRS = Conn.Execute(strSQL)
%>
I have a primary key field named StaffNo in the Staff table, and a foreign key inthe Validation table named StaffNo. I'm trying to insert data into the Validation table from a form with radio buttons being used for Validation 1, Validation 2, Validation3, etc.
Thanks.
I'm getting the following error in my asp code and i'm not sure how to fix it.
Microsoft OLE DB Provider for SQL Server error '80040e2f'
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Validation_Staff'. The conflict occurred in database 'TrainingEvaluation', table 'Staff', column 'StaffNo'.
/Evaluation/you-result.asp, line 29
The code I have at the moment is:
<%
Dim strSQL, objRS, strStaffNo, strCoursekey, strCourseDate, strtrainer, strQ1, strQ2, strQ3, strQ4, strQ5, strOther
strStaffNo = Request.QueryString("StaffNo")
strCoursekey = Request.QueryString("CourseKey")
strCourseDate = Request.QueryString("Trainer")
strTrainer = Request.QueryString("CourseDate")
strQ1 = Request.QueryString("Q1")
strQ2 = Request.QueryString("Q2")
strQ3 = Request.QueryString("Q3")
strQ4 = Request.QueryString("Q4")
strQ5 = Request.QueryString("Q5")
strOther = Request.QueryString("Other")
strSQL = "Insert into Validation (StaffNo, CourseKey, TrainerNo, CourseDate, ValidationQ1, ValidationQ2, ValidationQ3, ValidationQ3a, ValidationQ4, ValidationQ5) values ('" & strStaffNo & "'" &_
", '" & strCourseKey & "', '" & strTrainer & "', '" & strCourseDate & "', '" & strQ1 & "', '" & strQ2 & "'" &_
", '" & strQ3 & "', '" & strQ4 & "', '" & strQ5 & "', '" & strOther & "') "
Response.Write "Thank you for completing this course feedback form."
GetConnection
Set objRS = Conn.Execute(strSQL)
%>
I have a primary key field named StaffNo in the Staff table, and a foreign key inthe Validation table named StaffNo. I'm trying to insert data into the Validation table from a form with radio buttons being used for Validation 1, Validation 2, Validation3, etc.
Thanks.