Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

there's any way to save the connection result in a variable

Hi dear experts,

there's any way to save the connection result in a variable or something,

I mean if the connection is success or not then sabe that result in a boolean or something like that?

regards Experts.

2 Replies
maxgro
MVP
MVP

maybe

// on error continue

set ErrorMode=0;

// wrong connection

OLEDB CONNECT32 TO [Provider=OraOLEDB1.Oracle.1;Persist Security Info=True;User ID=test;Data Source=dev11;Extended Properties=""] (XPassword is EJXTIKVITCVUM);

// store result

set vResult=$(ScriptError);

trace connection result is $(vResult) ;

// halt andprompt user on error

set ErrorMode=1;

the execution log is

Connecting to Provider=OraOLEDB1.Oracle.1;Persist Security Info=True;User ID=test;Data Source=dev11;Extended Properties=""

Failed to connect

connection result is General Error

Not applicable
Author

Thanks Massimo,

I only replace the variable ScriptError with ScripErrorcount

just one more think ,

there's any way to send the ODBC since a variable?

Regards.