We are running InfoPath 2003 with a SQL database. I designed a form and it worked (all fields came up as required and SUBMIT actually wrote to the SQL database). But then I added a CHECKBOX for my users to check incase they did not have any leave/fluctuations and now when I hit SUBMIT I constantly get this error:
0x80040E2F][Microsoft OLE DB Provider for SQL Server] Cannot insert duplicate key row in object 'dbo.Leave_Data' with unique index 'IX_Leave_Data'.
[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement has been terminated.
=============================================================================================================
I have attached a copy of the form for you to see how it was built.
|
START DATE |
END DATE |
DETAILS |
# OF DAYS OFF |
LEAVE TYPE |
|
|
|
|
|
Select...V-PS-PS-FCommCompStudyCo-opJuryV-NLTDAMPGWETOEETOT |
|
|
|
|
|
|
LEAVE WITH PAY: LEAVE WITHOUT PAY:
V-P: Vacation with Pay (#16155) V-N: Vacation without Pay (#16155)
S-P: Sick - Personal Days (#16160) LTD: Long Term Disability (#16215)
S-F: Sick - Family Days (#16160) A: Adoption Leave (#16178)
M: Maternity Leave (#16178)
P: Paternity Leave (#16178)
OTHER: G: Government EI Compassionate Leave
Comm: Community Day (#16181) W: WCB
Comp: Compassionate Leave (#16176)
Study: Study Day (#16170) ETO (Earned Time Off) :
Co-op: Camp Counselor (#16184)
Jury: Jury Duty (#16177) ETOE: ETO Earned
ETOT: ETO Taken
OUTSTANDING FLUCTUATIONS (Explain):
|
Date |
+/- Reg. Hours Worked |
Explanation of Regular Hours Adjustments |
+/- Overtime Hours Worked (PAY) |
+/- Overtime Hours Worked (BANK) |
Explanation Of Overtime Hours
Worked |
Total Reg. Hours Adj. |
Total Adj. To O/T Hours Worked |
|
|
|
|
|
|
|
|
|
CLICK HERE IF NO TIME TAKEN OR FLUCTUATIONS TO REPORT :
===============================================================================================================
I have (3) SQL tables:
-
dbo.Employee_Information
-
dbo.FLUCTUATIONS
-
dbo.Leave_Data
I have my ID column in Employee Information as the PK and Allow Nulls is unchecked.
I have my ID column in FLUCTUATIONS and Leave_Data as the uniqueidentifier
I hope this is enough information for you to help me.
Regards
'Newbie' Duane Hamilton