How do I connect the controls in the form to a database? - InfoPath Dev
in

InfoPath Dev

How do I connect the controls in the form to a database?

Last post 09-08-2008 07:40 PM by Newb2008. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-07-2008 08:43 PM

    How do I connect the controls in the form to a database?

    I am trying to make a form using Microsoft InfoPath that submits its data to a SQL database so I can later query the data. When I add controls to the form, it seems to create data fields but those data fields are not connected to any database so I cannot query the information once it has been put in. It seems like all I can do is send the form to a group of people via email.

     So what I did was create a database and table in SQL and connect the application to the database. This allowed me to drag and drop the individual database fields (columns) that I created in SQL directly into the application. However, this is a cumbersome process.

     Does anybody know how I can just add controls to the form and then connect that form into SQL for the purpose of submitting and querying data? Essentially what I am asking is do I have to create a database and link to the database and then add controls to the form via dragging and dropping? Can’t I just add controls to the form in the design mode and then link those controls to a database without having to create a database to begin with?

  • 09-08-2008 12:02 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: How do I connect the controls in the form to a database?

  • 09-08-2008 07:40 PM In reply to

    Re: How do I connect the controls in the form to a database?

    Thanks Anuma, that was the process I went through (the one in the first link) and It won't let me submit data to the SQL database. I created a table in SQL, connected it to infopath 2007 and dragged the data and querry fields onto the form. I can query information already in the database (I put the info in as a test) but I cannot submit to the database.

     

    I selected submit NOT receive when I selected a connection type, yet it changes to query type connection while going through the steps. It tells me that submit is not enable for this connection because one or more tables in the datasource do not have a primary key, index, or unique constraint.

    I only had one table in the database but I decided to add another and assign primary and foreign keys, but this did not help, I am still not able to submit to the database.

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