Is this possible when submitgting data to Database...?

C

Christoph

I'm trying to set up a form that submits data to a table (on SQLServer)
that has a column set up as an "identity" column. Naturally, there is a
constraint on that column saying that it must contain data.
I set up that table as a data source and I drag the columns to the form
to be set up as controls. But since the ID column is a behind the scenes
kind of thing, I remove that from the form; the user could care less about
that column and will likely not understand what it means. Now, when
the end user fills out and submits that form, the user recieves an error
saying that the ID column can't be blank. *sigh*
Is there a way that I can set it up in InfoPath so that when it goes to
insert the form data into the table in the database, it doesn't use that
column name in the INSERT statement so that the database can assign
that value automatically. I thought that perhaps if, when setting up the
data source, if I didn't select that column, it wouldn't use it in the
INSERT
statement. But that columns checkbox is greyed out and so I can't de-
select it.
So is there a way I can do this? Tell InfoPath not to use the ID column
when it goes to insert the form data?

thnx,
Chris
 
R

Roger Jennings

InfoPath SP-1 (and the RTM version) handle INSERTs to tables with identity
primary keys automatically. It also handles assigning the new identity value
to related records (e.g., new OrderID in an inserted Orders table to new
Order Details records.)

The details for SP-1 are in Chapter 13 of "Introducing Microsoft Office
InfoPath 2003." There's a Web service example of the Chapter 13 form at
http://www.oakleaf.ws/InfoPath/nworders.aspx.

--rj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top