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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 | |
|
|