1. S Lambert
  2. PowerBuilder
  3. Friday, 4 November 2022 16:17 PM UTC

Hello,

I try to connect with Powerbuilder 2022 x64 with ODBC to PostgreSQL x64

For 32bits I use the code 

ls_dbparm = "ConnectString='Driver=PostgreSQL Unicode;"
ls_dbparm += lnv_ini.of_getconnect_database( )
ls_dbparm += lnv_ini.of_getconnect_server( )
ls_dbparm += lnv_ini.of_getconnect_poort( )
ls_dbparm += lnv_ini.of_getconnect_user( )
ls_dbparm += lnv_ini.of_getconnect_wachtwoord( )
ls_dbparm += "TextAsLongVarchar=1;BoolsAsChar=1;MaxVarcharSize=255;MaxLongVarcharSize=8190;ReadOnly=0;SSLmode=disable;UseServerSidePrepare=0;LFConversion=1;UpdatableCursors=1;XaOpt=1"

this doesn't work with ODBC x64, so I changed it to

ls_dbparm = "ConnectString='Driver=PostgreSQL Unicode(x64);"

but I got the same result.

Tried several other ways but got still the same result, it ask for a datasoure

Does anybody have a idea how to do this.

greetings,

Steven

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 4 November 2022 16:49 PM UTC
  2. PowerBuilder
  3. # 1

Did you create a 64-bit DSN in the 64-bit ODBC administrator?

Did you compile your app to a 64-bit .EXE and run the EXE (not run from the PB IDE)?

Please note that the DB painters in the PB IDE are 32-bit so it can only use 32-bit DSN to connect to Postgres.

PB 2022 has option to run and debug the 64-bit app in the PB IDE, but 2021 and older versions only run 32-bit in the IDE.  So only the 64-bit compiled .EXE is running 64-bit.

Comment
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Saturday, 5 November 2022 08:20 AM UTC
  2. PowerBuilder
  3. # 2

Adding to what Armeen said
Ensure that 64 bit driver is installed and check the driver name is exactly same that you add in the dbparm parameter

HTH

Happiness Always
BKR Sivaprakash

 

Comment
There are no comments made yet.
S Lambert Accepted Answer Pending Moderation
  1. Saturday, 5 November 2022 15:42 PM UTC
  2. PowerBuilder
  3. # 3

Thank you for thinking along. While describing the problem in more detail, I found out what the cause is. The decryption of the password in the 64-bit environment makes a mistake, which throws things into disarray. Took it out and everything works fine.

Sorry I didn't see this before.

Regards,
Steven

Comment
  1. John Fauss
  2. Saturday, 5 November 2022 15:44 PM UTC
Super news, Steven! Thank you for sharing the solution. Would you please take a moment and mark this issue as resolved? Thank you!
  1. Helpful
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.