Solved

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

Posted on 2012-04-04
2
415 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

739 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