M
Matt.W.Stephens
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?
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?