[AccessD] Trap SQL Server errors in MS Access/VBA?

Ryan W wrwehler at gmail.com
Wed Nov 8 11:24:31 CST 2017


I have some stored procedures that run when a user clicks a button or does
a task and occasionally the data that was imported to manipulated sometimes
erroneously contains a zero.. so my procedure dies when it tries to divide
by zero.

Right now when that happens (and it doesn't happen often) is my app just
gives me "Error 3146 ODBC-- call failed" messages.

I'd like to actually trap the SQL Error.  I have a Try/Catch in that SPROC
and a riaseerror statement but those don't spit out on the access side.  Is
there a way to trap that error and display it to the user?


More information about the AccessD mailing list