Trying to get SQL Exception using "ADO.CreateADOCommand"
Hello there;
This is my first topic of doubt. I have been researching for some time without a solution and so I decided to ask, because even with some research inside and outside the Smartbear community I could not find a solution. :smileysad:
I am trying to execute an SQL statement in SQLServer through the existing ADO.Command in TestComplete, expecting the return of an exception.
The database only returns if there is a syntax error. However, if the syntax is correct, but the operation can not be performed, the database is not returning the exception. Just with the return of the exception I can handle the situation in my code.
Test execution needs to stop if the database fails to execute the statement I submitted to it.
Exemplifying:
I tried to use "try-except" in my delphiscript, but the database is not returning the exception forcing it to drop directly on the except line. (Neither using a division-by-zero statement)
I've also tried to create a T-SQL with a "try-except" forcing a raiserror, but even then, I'm not able to catch the exception.
I have looked at the properties in the ADO.CreateADOCommand and there is apparently no property to flag the exception.
I am believing that the database suppresses this information and it is not returning to the application.
Or maybe I'm failing at something I have not yet observed.
Could anyone tell me what might be happening? And how could I solve this to get the exception I hope so much?
Thank you. :smileyhappy: