Mikaymikz Posted October 25, 2014 Share 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 Link to comment
Miguel Barrera Posted October 26, 2014 Share 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 Link to comment
Mikaymikz Posted October 27, 2014 Author Share Posted October 27, 2014 Thank you, sir. I will try it out. Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted November 6, 2014 Vectorworks, Inc Employee Share 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 Link to comment
Mikaymikz Posted November 6, 2014 Author Share Posted November 6, 2014 Thanks Sasha! I appreciate it. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.