TADOQuery Error Handling



I have an application that allows users to generate a query which is then
executed to return data to a grid on an application form. All works well
unless SQL statement generates an error (i.e. syntax, etc) which causes the
application to fail. I have attempted to trap this error with Try...Except
on ADOQuery.Open, ADOQuery.Active, ADOQuery.ExecSQL and have not been able
to trap the error successfully. If anyone could direct me to a resource
that describes or provides an example of an approach to trap these errors I
would appreciate the assistance. Thanks.


.



Relevant Pages

  • Re: complicated IIF
    ... The logic can be changed to trap the Null and then combined with the Nz ... Assuming that [ParentalStress] is an integer, the logic could be changed to ... The field is in a query that does a lot of calculation already. ...
    (microsoft.public.access.reports)
  • Re: Delete query if it exists
    ... I can trap the error and move on. ... Judy ... > To test for the presence of the query without allowing an error to occur ... > Dim qdf As DAO.QueryDefs ...
    (microsoft.public.access.formscoding)
  • Re: conditions to equal "#Error" in Text Box
    ... Trap the error in the query so that you can display a value of your choosing ... > automatically with a macro. ...
    (microsoft.public.access.macros)
  • Re: DoCmd.RunSQL
    ... error if the query exists or not. ... I'm changing SQL statements inside queries, ... database to bloat until a compact is done. ... you would have to error trap ...
    (microsoft.public.access.modulesdaovba)
  • Re: how do I query last date
    ... SQL statement would look like ... GROUP BY [Trap ID] ... In the query grid, build a new query ...
    (microsoft.public.access.queries)