Violation of PRIMARY KEY constraint - InfoPath Dev
in

InfoPath Dev

Violation of PRIMARY KEY constraint

Last post 10-08-2010 04:16 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-08-2010 05:29 AM

    Violation of PRIMARY KEY constraint

    I created a database connection form and have it published to a SharePoint library. When the user submits the form for the first time, the form saves to a SharePoint library and also a database. No problem. When the user goes and open ups the previously submitted form, makes a change and submits again, they get an error InfoPath cannot submit the form. An error occurred while the form was being submitted. Violation of PRIMARY KEY constraint 'primary key'. Cannot insert duplicate key in object 'database'. This form used to work but I changed the form and added custom events to buttons. Since then I get the PRIMARY KEY error. This is a Infopath 2007 form using Visual Basic for the coding.

  • 10-08-2010 04:16 PM In reply to

    Re: Violation of PRIMARY KEY constraint

    Hi Avanburen,

    You should be using some kind of a data-driven Web service for this. The tight coupling to a database is going to cause you a lot of pain down the road.

    Make sure the XML you are opening was created with the new version of the form. If not, that could be causing a problem. Did the schema change when you added the custom events? If so, your XML is worthless. That's the main problem with tightly coupled InfoPath->DB solutions.

    If the schema didn't change and the form is opened from the new version, my guess is that you are saving the form to ShP before you submit to DB. IF so, the form doesn't contain the right ADO goo to tell the DB it's an update as opposed to a duplicate.

    That's all I can think of for now.

    Happy trails,

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.