Solved

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

Posted on 2012-04-04
2
412 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

778 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