Connect to a PostgreSQL database through ODBC on Excel 2016

B F picture B F · Aug 12, 2016 · Viewed 11.3k times · Source

I'm having trouble using ODBC to connect from Excel 2016 to a PostgreSQL database.

I tried to follow this answer, without success, and this solution from MS, without any better results...

Has anyone ever succeeded at this? I saw that Excel 2016 had some troubles with ODBC drivers, but that was like a year ago, so I was wondering if things may be better now?

Thank you for your help.

Answer

Hambone picture Hambone · Aug 12, 2016

My guess is this is a 32/64 bit thing. It's the single biggest issue we've had with setting people up on PostgreSQL within Excel/Access.

Bottom line: if your Excel instance is 32-bit (which is often the case), then you need to use the 32-bit ODBC driver. The latest Pg ODBC driver has both bundled in the same assembly, so the trick is to go into 32-bit ODBC and set up the driver that way.

From there, it should all be straight-forward:

  • Data Tab
  • From Other Data Sources
  • Microsoft Query
  • Select the Data source you just set up

And so on.