I'm doing an integration between a Navision system running on Native DB (3.70) and another system running on SQL Server 2005.
Everything works fine and runs as fast as the wind, except for those times when my T-SQL execution gives an error. I can't find any way to fetch that error in Navision.
I'm running this code:
Var:
ASDatabase : 'Microsoft SQLDMO Object Library'.Database2
ASResults : 'Microsoft SQLDMO Object Library'.Results
ResultMsg : Text[1024]
ASResults := ASDatabase.ExecuteWithResultsAndMessages2(Command, ResultMsg, STRLEN(Command));
In the help description for the execute method it says that messages from the run should be put into ResultMsg, but still I get an runtime error dialog that stops the program. ](*,)
Does anyone know if it's possible to catch errors from the execution (for example the run of a stored procedure) and handle it without stopping the program run? I guess that normal messages (not error) will be returned in ResultMsg.
Comments
http://www.mibuso.com/forum/viewtopic.php?p=106095#106095
But if someone has more suggestions of how to do it, please write a line or two.