Help, I am new to infopath and am stuck on my first form - InfoPath Dev
in

InfoPath Dev

Help, I am new to infopath and am stuck on my first form

Last post 03-25-2009 08:22 AM by dghamilton. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-05-2008 09:34 AM

    Help, I am new to infopath and am stuck on my first form

    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.

    Full-Time Staff Monthly Absenteeism/Overtime Record
     
    For The Month Of:
     
     
    Employee ID:
     
     
     
    Name:
     
    Job Title: 
     
    Email Address:  
     
    Job Code (for HR):
     
     
    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
     
     
     
     
    • Attendance records must be signed and dated and forwarded to the HR Coordinator by the 5th of every month.
    • Use proper codes as indicated above when filling in “Types of Leave” on the form.
    • Maximum bankable days is five, these days must be taken in no less than ½ day increments.
    • All overtime must be pre-authorized by your manager.
     
     
    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

     
     
                                                           
  • 11-08-2008 09:54 PM In reply to

    Re: Help, I am new to infopath and am stuck on my first form

    Hey Duane.

    This looks like an issue with your primary key in your child tables, specifically Leave_Data.

    You either need to generate the correct unique ID in your form so that it does not duplicate or have Identitiy on in SQL so that one is generated automatically.

    Your submit is blocked since the new Leave-Data record either does not have a ID or it is not unique.

  • 03-25-2009 08:22 AM In reply to

    Re: Help, I am new to infopath and am stuck on my first form

    Hi Clay,

    Yes the problem was with how I was picking/setting my primary key. The problem I have now is that I can have the user enter in as many

    sick days etc as needed and hit SUBMIT. It writes to the database fine. But when you go back in as the same user and enter in your credentials

    it brings up all instances again? Is there some way to restrict past occurences being pulled from the database.

     

    Thank you

    Duane Hamilton

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.