Link to home
Start Free TrialLog in
Avatar of zac
zac

asked on

Exceptions, MS SQL & ODBC

When I add a record which invalidates referential integrity to a MS SQL database (using ODBC) in code I recieve no exception, however when I enter the same data using a visual component I recieve the exception - how can I get the exception to be generated by my code?
Avatar of joseramos
joseramos

I don't know if I understood the question ... but you may try wrapping your code within a try/except block:

        try
           { ... your code that invalidates referential integrity }
        except
            raise;     { or however you want to handle it }
        end;
Avatar of zac

ASKER

The problem is that although an exception should be generated by the code, it is not!

I have found a work-arround which is to use queries, however I would be interested in finding out the reason for this strange behaviour.
ASKER CERTIFIED SOLUTION
Avatar of Pegasus100397
Pegasus100397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial