Connection to PostgreSQL from Excel

Started by Paul Suworowover 7 years ago3 messagesgeneral
Jump to latest
#1Paul Suworow
paul.suworow@gmail.com

Hi team,

I am working on an Excel tool that should allow users to update tables and charts from a PostgreSQL database. My workbook currently connects to the database using the following VBA code:

Set objConnection = CreateObject("ADODB.Connection")

    ConnString = "DRIVER={PostgreSQL Unicode};DATABASE=FMS;SERVER=[x];PORT=5432;Uid=[x];Pwd=[x]"

 objConnection.Open ConnString

All works fine but the code requires PostgreSQL driver to be installed on user's machine.

Is there an alternative way to connect to a PostgreSQL database without pre-creating DNS or installing any drivers in advance?

Thank you for your help!

Kind regards,
Paul

#2Łukasz Jarych
jaryszek@gmail.com
In reply to: Paul Suworow (#1)
Re: Connection to PostgreSQL from Excel

Hi,

i think that this is not possible to avoid installing driver.

pon., 27 sie 2018 o 09:55 Paul Suworow <paul.suworow@gmail.com> napisał(a):

Show quoted text

Hi team,

I am working on an Excel tool that should allow users to update tables and
charts from a PostgreSQL database. My workbook currently connects to the
database using the following VBA code:

Set objConnection = CreateObject("ADODB.Connection")

ConnString = "DRIVER={PostgreSQL
Unicode};DATABASE=FMS;SERVER=[x];PORT=5432;Uid=[x];Pwd=[x]"

objConnection.Open ConnString

All works fine but the code requires PostgreSQL driver to be installed on
user's machine.

Is there an alternative way to connect to a PostgreSQL database without
pre-creating DNS or installing any drivers in advance?

Thank you for your help!

Kind regards,
Paul

#3Paul Suworow
paul.suworow@gmail.com
In reply to: Paul Suworow (#1)

Hi team,

Thank you for your great work! I am developing an Excel tool that should allow users to update tables and charts from a PostgreSQL database. My workbook currently connects to the database using the following VBA code:

Set objConnection = CreateObject("ADODB.Connection")
ConnString = "DRIVER={PostgreSQL Unicode};DATABASE=FMS;SERVER=[x];PORT=5432;Uid=[x];Pwd=[x]"
objConnection.Open ConnString

All works fine but the code requires PostgreSQL driver to be installed on user's machine.
Is there an alternative way to connect to a PostgreSQL database without pre-creating DNS or installing any drivers in advance?

Thank you for your help!

Kind regards,
Paul