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

Stuart McLachlan stuart at lexacorp.com.pg
Wed Nov 8 14:50:17 CST 2017


Try iterating throught the DBEngine.Errors collection and look at the error descriptions.



On 8 Nov 2017 at 11:24, Ryan W wrote:

> 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? -- AccessD mailing list AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd Website:
> http://www.databaseadvisors.com
> 




More information about the AccessD mailing list