Mikaymikz 0 Posted October 25, 2014 (edited) Can someone please tell me how to use the function "DBSQLExecuteError" in Vectorscript? I'm not sure if I am doing it right, but below is my sample code which has given me two results, so far. SAMPLE SCRIPT PROCEDURE CheckDBError; VAR msg , state, internalDesc : DYNARRAY[]OF CHAR; code : LONGINT; error : BOOLEAN; BEGIN error := DBSQLExecuteError(msg, state, code, internalDesc); AlrtDialog (Concat('Error Output = ', code)); END; Run(CheckDBError); =========================================================== RESULT 1. -1317141234 2. 2883687 Thanks. Sincerely, Mikay Edited October 25, 2014 by Mikaymikz Quote Share this post Link to post
Miguel Barrera 18 Posted October 26, 2014 Should be placed right after a call to an ODBC function that returns FALSE such as IF DBSQLExecuteDSN() THEN BEGIN ... ... {Continue code} END ELSE IF DBSQLExecuteError() THEN BEGIN ... ... {Write out error information} END; Quote Share this post Link to post
Mikaymikz 0 Posted October 27, 2014 Thank you, sir. I will try it out. Quote Share this post Link to post
Alexandra Nikolova 0 Posted November 6, 2014 Here is a sample how to use it. PROCEDURE Test; VAR ok : BOOLEAN; message, state, internalDesc : DYNARRAY[] OF CHAR; code, colCnt, resSetInst : LONGINT; BEGIN ok := DBDocAddConn( 'MyTestODBCDatabase', '', '' ); ok := DBSQLExecuteDSN( 'MyTestODBCDatabase', '', '', 'SELECT * FROM Spaces', colCnt, resSetInst ); IF NOT ok THEN BEGIN ok := DBSQLExecuteError(message, state, code, internalDesc); AlrtDialog(Concat('state: ', state, Chr(13), 'message: ', message, Chr(13), 'code: ', code, Chr(13), 'intDesc: ', internalDesc)); END; END; RUN(Test); Quote Share this post Link to post
Mikaymikz 0 Posted November 6, 2014 Thanks Sasha! I appreciate it. Quote Share this post Link to post