Solved

MS Access - Trying to intercept SQL Server unique index error with error-trapping

Posted on 2012-04-04
2
409 Views
Last Modified: 2012-04-24
I dropped a unique index on an INT column in a SQL Server 2008 table.  The index does its job, but it would be nice to present the Access 2007 front-end user with an error message that's a little friendlier than the following:

"Cannot insert duplicate key row in object 'dbo.blabla..' with unique index 'Idx_blablabl'. The statement has been terminated at..."

I could put a little code under the hood in Access under the corresponding field's Before_Update event to check for unique values, but I'd like to simply error trap the error thrown by SQL Server.  Suggestions?
0
Comment
Question by:jdana
2 Comments
 
LVL 12

Accepted Solution

by:
danishani earned 500 total points
ID: 37809599
You may look into below similar thread, to find your answers/ methods for doing so:
http://www.sqlservercentral.com/Forums/Topic300275-131-1.aspx

or when using an ODBC:
http://support.microsoft.com/?id=209855
0
 

Author Closing Comment

by:jdana
ID: 37887861
Thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now