InfoPath, SQL and GUIDs

D

DaveFroMelandra

I need the help of a brain superior to my own.

Quite simply I have a tiny SQL database. I will make this more complex, but
not before I overcome this elementary problem.

Customers
CustomerGUID - unique identifier - does not allow nulls - default value
newid()
CustomerName - nchar 100 - does not allow nulls - no default value

I would like to create a simple InfoPath form that enables a user to add a
new customer to the database.
I would like them to be able to simply type the name of the customer in the
Customer box and click submit.
I have successfully created the link to the appropriate data source, namely
the database with the customers table in it.
I set up a data view and dragged from the task pane to the main window to
create a text box labelled Customer Name.
I added a control: a button.
I changed it properties so that it bacame a submit button.

When I preview the InfoPath form and try to submit a companu called test, I
see the error message, "Field or Group: CustomerGUID. Error: only specific
pattern allowed".

How do I overcome this?

Can InfoPath generate GUIDs? If not, how can I persuade InfoPath to pass the
appropriate information to SQL so that a new row is added to the database
generating the GUID automatically?

Thank you,
Dave
 
D

dbsearch04

It looks like you don't care aabout duplicate names. Make sure (using
QueryAnal) that you can do an insert without specifying the GUID. Then
get infopath to only supply the name.

Regards..
 
D

DaveFroMelandra

Thanks for the response. If I gave the impression that I didn't care about
duplicates then I gave the wrong impression.

My objective isn't to find a workaround by restructuring the database schema.

I want to find out how to submit data to a normalised database using
InfoPath where each row in each table is unique
 
D

DaveFroMelandra

Thank you for your reply. I must have given the wrong impression.

I would like to use InfoPath to submit data to a normalised database where
each row in each table is unique.
 
D

DaveFroMelandra

Hi Sophie.
Avoiding GUIDs entirely and using identity columns is a mild workaround.
However, I have failed miserably to persuade InfoPath to write data to
multiple tables. I even tried creating a SQLview containing all relevant
fields, but to no avail.

Can anyone else help us?

Dave
 

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