Submit to a SQL Database - Greg Collins
in

InfoPath Dev

This Blog

Syndication

Greg Collins

Submit to a SQL Database

When creating a new form from a SQL database connection, there are a couple of things to remember in order to enable the Submit To Database feature.

  1. The SQL tables used must have a primary key, unique constraint, or unique index. Without this you will receive the following error in the summary of the Data Connection Wizard:

    Submit status: Not allowed - One or more of the tables in the data source do not have a primary key, unique constraint, or unique index.

  2. The SQL database tables must not include the following data types: image, ntext, text. These are considered long data types and are not supported within InfoPath. If your tables include any of these data types you will receive the following error in the summary of the Data Connection Wizard:

    Submit status: Not allowed - One or more of the columns in the data source has a long data type (text, ntext, hyperlink or image). Long data types are not supported.

  3. Other things may prevent you from submitting to your database. Here's a couple of other reasons that will prevent you:

    Submit status: Not allowed - A table is being used many times

    Submit status: Not allowed - A many to one relationship might exist between two tables in the data source.

If you have successfully satisfied the conditions, the summary of the Data Connection Wizard will inform you that submit is enabled. To then submit to your database, perform the following steps:

  1. Drag a Button control into the view from the Controls task pane.
  2. Double-click the new button to open the Button Properties dialog box.
  3. On the General Tab, change the button action to Submit.
  4. On the Submitting Forms dialog box, the Submit To drop-down list box should have the value Database pre-selected. Click OK to accept the defaults.
  5. Click OK again to close the Button Properties dialog box.

That's it -- you're done! You are now set up to submit your form entries to your SQL database.

©2005 Greg Collins. All rights reserved. Licensed to Autonomy Systems, LLC for display on InfoPathDev.com.

Published Jul 27 2004, 06:58 PM by Greg Collins
Filed under: , ,

Comments

 

bobspearing said:

This isn't available - "To drop-down list box should have the value Database pre-selected."

I'm going crazy here trying to submit!

November 16, 2007 8:49 AM
 

submit data from infopath to SQL | keyongtech said:

Pingback from  submit data from infopath to SQL | keyongtech

January 21, 2009 5:12 PM
 

chris leate said:

Does anyone know if the same restrictions regarding long binary types applies to web methods?

I tried using UDC but the restriction of data is annoying and I would like to use nVarchar as well as storing data such as attachments.

Is this just a restriction of UDC or is it more widespread?

March 31, 2010 9:37 AM
 

ramii said:

Hi Greg, thanks for the post. I have similar question regarding retrieving the records from multiple tables, I was able to retrieve it from a table using its primary key. However if I try to retrieve it using any other column in the table its not populating any results. I appreciate if you can give some suggestion on it.

Thanks,

Ramii

February 7, 2011 3:05 PM
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.