Search code examples
postgresqlms-accessodbcconnection-stringpsqlodbc

Connecting MS Access to PostgreSQL Server


I'm having trouble with connecting to our postgres server. I was given the code used to connect ms access to our SQL Server. It shall be DSN-less, I have installed an ODBC-driver and now I'm stuck finding the correct connection string to write in access' vba code.

I know it has to be somewhat like this:

stConnect = "ODBC;Driver={PostgreSQL UNICODE};Data Provider=pgsqlODBC;hostaddr=[IP-adress];Port=61000;dbname=TE_TestFirst;user=admin;password=testtest;"

Or maybe like this:

stConnect = "ODBC;Driver={PostgreSQL UNICODE};Data Provider=pgsqlODBC;SERVER=[IP-adress];PORT=61000;DATABASE=TE_TestFirst;UID=admin;PWD=testtest;"

I have read that 64Bit-Pcs need to have been given the "Data Provider". Yet nothing works except the DSN version which we don't want. I've copied countless connection string from various sides, maybe I'm overseeing something?

I look forward to your replies and thank you in advance. Puddingloeffel


Solution

  • In the end we did the following:

    Using connection string "PostgreSQL Unicode(x32)" written like shown above + using a different script to connect to

    It now works fine and DSN-less :)