Hi Ek38
When you created the data connection, did you specify that the field was primary key? You may want to look at the wizard again. I thought there was a specification required for single table cases. Usually, you'll have the repeating table under another table and that should work fine since it knows it's got a foreign key. This should work but may require reshaping your data connection.
Keep in mind that InfoPath SQL data connection has numerous limitations:
-
Can't use with browser-enabled forms when SQL on a different server
-
Can't use with XML data types (like images and rich text)
-
Changes to DB or XSN render previously saved XMLs invalid (not an issue if you disable save)
-
Doesn't work in an extranet scenario
-
etc.
That's why the best practice is to use a Web Service. Qdabra freely pays for this forum and our goal is to answer 90% of all posts (some posts are about solving World Peace, etc. which we think is unobtainable given the species). Qdabra sells an inexpensive Web Service accelerator called "DBXL" that you can use to map your forms to SQL. It has many other benefits too (fills lots of SharePoint gaps). Rather than write one Web Service for each form template, DBXL provides a data-driven solution. So, in addition to saving you boat loads of time, you also save money since you can use the same Web Service for all of your InfoPath templates.
Best of luck with your mission,