Postgres ODBC connection fails in EXE
- New
- How-to
-
Rich Gibson
- PowerBuilder
- Thursday, 12 February 2026 02:31 AM UTC
Working with PB2025 using Postgres database and have successfully converted the entire PB6.0 project to PB2025 in the IDE. I have been using the ODBC connection quite successfully in the IDE but now that I have compiled to an EXE file, the database connection no longer connects. You can see from the connection string that my database is running on another computer in the building at a different IP address.
The sqlca.sqlerrtext says:
SQLSTATE = 07002 Parameters exist but IPD isn't set. Please call SQLDescribeparam()
This is the profile within the IDE
// Profile PGBCServer
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = True
SQLCA.DBParm = "ConnectString='DSN=PostgreBCServer;UID=postgres;PWD=<******>',PBCatalogOwner='public',TableCriteria=',public'"
and my connection within the code is
sqlca.DBMS = "ODBC"
sqlca.DBPARM = "Connectstring = 'Driver=PostgreSQL ANSI;Database=bci;Server=192.168.2.40;Port=5432;UID=postgres;PWD=PostgreSQL'"
I've tried converting to ADO.net but I can't even get the DBProfile to connect
// Profile PGADO
SQLCA.DBMS = "ADO.Net"
SQLCA.LogPass = <**********>
SQLCA.LogId = "postgres"
SQLCA.AutoCommit = FalseSQLCA.DBParm = "Provider='PostgreSQL',host='192.168.2.40',port='5432',PROVIDERSTRING='SSL Mode=Disable;'"
-- Rich
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.