PostgreSQL Query to Excel Sheet

孤街浪徒 提交于 2019-11-30 06:41:40

You could install the PostgreSQL ODBC driver on the Windows machine, and then connect Excel to the database like explained in this blog post (except using ODBC rather than OLEDB).

I haven't tested this. I'm not really sure if this makes it any easier than exporting CSV and fixing it (given what Excel is like).

EDIT (thanks @Tometzky): The best solution is to use the PostgreSQL ODBC driver to connect Microsoft Access to the database and from Access export to Excel.

Apparently you can use Power Query Add-in and the .Net PostgreSQL Data Provider for importing PostgreSQL data into Excel 2010 or Excel 2013...

Download http://www.microsoft.com/en-au/download/details.aspx?id=39379

How to for using PostgreSQL: https://support.office.com/en-ie/article/Connect-to-a-PostgreSQL-database-bf941e52-066f-4911-a41f-2493c39e69e4

This is fairly easy.

Make this the first line of .asp page: <%response.ContentType="application/vnd.ms-excel"%>

Make the rest like any other HTML page with a table in it.

Use ASP to fill the table with data from the database.

The server will create an Excel spreadsheet for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!