Submit to SQL - Only specific pattern allowed - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Submit to SQL - Only specific pattern allowed

Last post 12-15-2009 06:18 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-09-2009 09:05 AM

    Submit to SQL - Only specific pattern allowed

    I have setup a sql table (just single table) with some columns, and one column for a primary key, that has a data type of 'uniqueidentifier', and has a default value of '(newsequentialid())'.

    Entering data from sql enterprise manager, I am able to create columns, and by leaving the primary key field empty, sql will auto-generate the guid when I save changes on the record.

    Next I setup a new infopath form (I have tested in both 2003 and 2007), creating from database connection.  It brings over all the fields fine, including the primary key.  When I try to submit a new record I get an error on the primary key field "Only specific pattern allowed".  This error occurs both if the primary key field is displayed on the form or not.

    Checking properties of the field, in the 'details' it has the pattern: 

    Pattern: "\{[0-9A-F]{8,8}\-[0-9A-F]{4,4}\-[0-9A-F]{4,4}\-[0-9A-F]{4,4}\-[0-9A-F]{12,12}\}"

    So, it is requiring something that looks like a GUID.  This explains the error, but I was expecting that the InfoPath form would allow for no value to be collected there, and then just allow the DB to create the GUID.  This is behaviour that is mentioned (but relating to Acess specifically) in this article:  http://office.microsoft.com/en-us/help/HA011199501033.aspx

    Is there a setting or option I am missing? 

    Any help with this would be greatly appreciated.  I want to avoid just auto-incrementing a number in the InfoPath form to use as a unique identifier.

     

    Cheers!

     

     

  • 12-15-2009 06:18 AM In reply to

    Re: Submit to SQL - Only specific pattern allowed

    Have you tried removing the pattern and adding logic to SQL to auto-increment the primary key?

    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.