Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unique index violation exception?

Status
Not open for further replies.

bebblebrox

IS-IT--Management
Aug 9, 2004
39
0
0
US
is a specific exception thrown if an insert into an access database via oledb causes a violation of a unique index?

 
Well I guess the best way to answer your question would be to write the code to catch any sql exception and print out the error. So basically, create the violation on purpose and see what you get. I have had to do this in the past to see what kinds of errors SQL Server would throw back to .NET
 
Look at the table you're tring to insert into, specifically any unique keys (primary and alternate) it might have on it. What the error is telling you is that you're tring to insert a second row that has the exact same key as a row that's already in the database.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top