1. Pierre DETE
  2. PowerBuilder
  3. Tuesday, 4 February 2020 16:17 PM UTC

Hi PB users,

Migrating to x64 our application, I m facing big Crash if my client is wrong configured. (No ORACLE_HOME env variable).

CONNECT; is crashing.

And I'm not able to catch the error wit Try... CATCH.

 

gf_info_64 ("Just Before Connect")

TRY
CONNECT ;
CATCH (runtimeerror myerror)
RETURN FALSE
END TRY

gf_info_64 ("Just After Connect")

Catches nothing.

Something Wrong ?

Thx

 

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 4 February 2020 17:06 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Pierre -

Consider using the GetContextService & GetContextKeywords PowerScript functions to determine if the Oracle-related environment variable is defined prior to attempting the Connect.

Regards, John

Comment
There are no comments made yet.
Pierre DETE Accepted Answer Pending Moderation
  1. Tuesday, 4 February 2020 16:59 PM UTC
  2. PowerBuilder
  3. # 2

Hi Kevin, sorry I missed saying that ORACLE_HOME is an important configuration env variable for oracle. My issue is to avoid all violent crash as with x64 I can't debug, only run the exe file !

Comment
  1. Kevin Ridley
  2. Tuesday, 4 February 2020 20:39 PM UTC
Yes I understand that. ORACLE_HOME is an environment variable that points to a folder. If you check for the existence of a known file in that folder, you can avoid calling the CONNECT and popup a messagebox saying they do not have Oracle client installed or similar. You can do the same thing by checking for a valid registry entry that should only be there if the install worked. Both of the below suggestions should work for you and avoid a crash.
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Tuesday, 4 February 2020 16:53 PM UTC
  2. PowerBuilder
  3. # 3

If you know what folder ORACLE_HOME points to and a sample file, why not just do a FileExists(filename) before even trying to connect?  You could also search the registry using RegistryGet for a certain entry that you get with a good install.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.