hi guys!
this is my code...
ON ERROR do errorHandler
lSqlString = "update a_item_masters set a_field_her 'a'"
&& This code should produce an ODBC Error
SQLEXEC(g_connHandle,lSqlString,"item_query"
< 0
MESSAGEBOX("if this messagebox appears, errorHandler dosen't work"
ON ERROR
PROCEDURE errorHandler
=AERROR(lar)
MESSAGEBOX(lar(2),48,"SQL Server Error"
RETURN TO MASTER
ENDPROC
supposedly, if the ON ERROR works after executing the SQLEXEC, the MESSAGEBOX wont appear anymore.
for the meantime, what i did is like this..
IF SQLEXEC(g_connhandle,lSqlString,"item_query"
< 0
do errorHandler
endif
.. which works just fine. but what if i have a series of updates, i have to do this IF..ENDIF statement just to insert the DO ERRORHANDLER.
is there a way on how i can make ON ERROR routine working in SQLEXEC command.
thanks!!!!
this is my code...
ON ERROR do errorHandler
lSqlString = "update a_item_masters set a_field_her 'a'"
&& This code should produce an ODBC Error
SQLEXEC(g_connHandle,lSqlString,"item_query"
MESSAGEBOX("if this messagebox appears, errorHandler dosen't work"
ON ERROR
PROCEDURE errorHandler
=AERROR(lar)
MESSAGEBOX(lar(2),48,"SQL Server Error"
RETURN TO MASTER
ENDPROC
supposedly, if the ON ERROR works after executing the SQLEXEC, the MESSAGEBOX wont appear anymore.
for the meantime, what i did is like this..
IF SQLEXEC(g_connhandle,lSqlString,"item_query"
do errorHandler
endif
.. which works just fine. but what if i have a series of updates, i have to do this IF..ENDIF statement just to insert the DO ERRORHANDLER.
is there a way on how i can make ON ERROR routine working in SQLEXEC command.
thanks!!!!