Duplicate db entries

N

NAVIN.D

I want to stop duplicate entries to the databse, suppose if the user table
has the same user name field and its unique, someone tries to entry same
username again i would perfer to show a message sayin that user name already
exists.

How do i do it?

Regards,
Navin.D
 
I

INTP56

I don't know how you would know what the error is, but in the Tools Menu ...
Submitting Forms ... Submit Options, there is a place for you to write your
own messages. In there, you could add some text to tell the user to hit the
"Show Detaills >>" button, and they would see something like this:

InfoPath cannot submit the form.
An error occurred while the form was being submitted.

[0x80040E2F][Microsoft OLE DB Provider for SQL Server] Violation of UNIQUE
KEY constraint 'UQ_NTP_Gas$GasName'. Cannot insert duplicate key in object
'dbo.NTP_Gas'.

[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement has
been terminated.

I use a naming convention so I can tell just by looking at the constraint
name what happened. In this case, a unique constraint "UQ" on the table
"NTP_Gas" on column "GasName" was violated.

I don't know how InfoPath could trap the error so you could deliver some
friendly text to the user describing what happened.

Hope that helps,

Bob
 

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