No VB runtime error when SQL statement fails

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jarek (I.hate.spammers.jarekbed_at_poczta.onet.pl)
Date: 02/06/04


Date: Fri, 6 Feb 2004 21:40:44 +0100

I am currently developing a VB6 program which uses MS Access over DAO.

When I issue an SQL statement which contains a syntax error, my VB error
handler jumps in and I can rollback the transaction. So far, so good.

But, when there is a constraint violation, the SQL statement still fails,
but no VB error is being generated. I cannot trap this situation, I cannot
rollback the transaction. I commit, and then the database is corrupted.

What can I do?



Relevant Pages

  • Re: No VB runtime error when SQL statement fails
    ... >> When I issue an SQL statement which contains a syntax error, ... >> handler jumps in and I can rollback the transaction. ...
    (microsoft.public.vb.database.dao)
  • Re: No VB runtime error when SQL statement fails
    ... >> When I issue an SQL statement which contains a syntax error, ... >> handler jumps in and I can rollback the transaction. ...
    (microsoft.public.access.queries)
  • No VB runtime error when SQL statement fails
    ... When I issue an SQL statement which contains a syntax error, ... handler jumps in and I can rollback the transaction. ... But, when there is a constraint violation, the SQL statement still fails, ...
    (microsoft.public.access.queries)
  • Re: No VB runtime error when SQL statement fails
    ... > When I issue an SQL statement which contains a syntax error, ... > handler jumps in and I can rollback the transaction. ... > But, when there is a constraint violation, the SQL statement still fails, ...
    (microsoft.public.access.queries)
  • Re: No VB runtime error when SQL statement fails
    ... > When I issue an SQL statement which contains a syntax error, ... > handler jumps in and I can rollback the transaction. ... > But, when there is a constraint violation, the SQL statement still fails, ...
    (microsoft.public.vb.database.dao)