A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excecute Error Handler before default SQL Server Error



 
 
Thread Tools Display Modes
  #1  
Old December 6th, 2006, 11:10 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 2
Default Excecute Error Handler before default SQL Server Error


I have an Access frontend that connects to an SQL Server backend. The
database opens a switchboard on open and the switchboard calls the SQL
Server for its contents. The problem I am having is when the user does
not have access to the SQL Server I need to catch the SQL Server Error
(which is alwasy 18456) and displaying my Error Handler Message before
the default error box pops up and asked the user about Trusted
Connections and so forth. My Error Handler looks like this

ErrorHandler:
If Err.Number = 3151 Then
MsgBox "To access this database, you must " & vbCr & _
"complete an IS request for access to" & vbCr & _
"database 'MYDATABASE' on server MYSERVER", vbCritical,
"You do not have access to this database"
DoCmd.Quit
Else
MsgBox Error$, vbCritical, "Error number " & Err.Number
End If


Is it possible to prempt the default SQL Server Error message?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.