Postgresql – Transfer datas from Access to PostgreSQL

ms accesspostgresqlvba

I'm trying to insert some data from Access to PostgreSQL database, but it's not a simple query, because it's a nested query.

For example :

rst.Open "INSERT INTO car(id, model, color, type) SELECT (id, model, color, type) FROM t_car"

Where rst is my recordset, and t_car is my Access table.

I know it should look like to a Postgresql request and t_car has nothing to do here, but I don't know how can I specify to this request :

go take informations from my Access table and insert these to my Postgres.

So I'm little bit lost with it, does someone can help me?

Best Answer

Install the PosgresQL ODBC driver and then use that to register Postgres tables in Access. Issuing the SQL you have given in Access will then transfer data from Access to PosgresQL.