Jump to content
Developer Wiki and Function Reference Links ×

How to use DBSQLExecuteError?


Mikaymikz

Recommended Posts

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 by Mikaymikz
Link to comment
  • 2 weeks later...
  • Vectorworks, Inc Employee

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);

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...