Excel连接Postgresql读取数据

Excel链接Postgresql读取数据

下载ODBC驱动

添加用户DSN

  • 根据你的版本选择32/64位的ODBC数据源进行设置,可通过控制面板-管理工具进入到这个界面:

image-20230203160432323

  • 打开ODBC 数据源(64位)-(注意:数据库编码格式为utf8的请选择Unicode的版本)

image-20230203160539995

  • 连接数据库(Postgresql的界面不同,但原理一样)

image-20230203160615897

使用数据源

  1. 添加查询连接:

image-20230203160802868

  1. 选择数据源并填入SQL:

image-20230203161333444

  1. 加载数据

image-20230203161235701

常见错误

  1. 驱动安装版本错误,此时如果你下载的是64位ODBC驱动,那么将32位的下载了即可

image-20230203160139161

  1. 如果安装驱动的过程中提示这个情况,将Visual Studio 2019安装后再将驱动安装就可以了,下面是各个版本的必要组件库下载路径,直接复制下载就可以了

image-20230203160303417

Microsoft Visual C++ Redistributable 2019
x86: https://aka.ms/vs/16/release/VC_redist.x86.exe
x64: https://aka.ms/vs/16/release/VC_redist.x64.exe

Microsoft Visual C++ Redistributable 2017
x86: https://go.microsoft.com/fwlink/?LinkId=746571
x64: https://go.microsoft.com/fwlink/?LinkId=746572

Microsoft Visual C++ Redistributable 2015
x86+x64: https://www.microsoft.com/en-pk/download/details.aspx?id=48145
x86+x64 update3: https://www.microsoft.com/en-us/download/details.aspx?id=53587

Microsoft Visual C++ Redistributable 2013
x86+x64 in all Language: https://support.microsoft.com/en-us/help/4032938/update-for-visual-c-2013-redistributable-package

Microsoft Visual C++ Redistributable 2012
x86+x64 in all Language: https://my.visualstudio.com/Downloads?pid=1452

Microsoft Visual C++ Redistributable 2010
x86-sp1: https://www.microsoft.com/en-pk/download/details.aspx?id=8328
x86-sp1-MFC-sec-update: https://www.microsoft.com/en-us/download/details.aspx?id=26999

Microsoft Visual C++ Redistributable 2008
x86: https://www.microsoft.com/en-us/download/details.aspx?id=29
x64: https://www.microsoft.com/en-us/download/details.aspx?id=15336
x86+x64-MFC-update: https://www.microsoft.com/en-us/download/details.aspx?id=26368

Microsoft Visual C++ Redistributable 2005
x86: https://www.microsoft.com/en-pk/download/details.aspx?id=3387
x64: https://www.microsoft.com/en-US/Download/confirmation.aspx?id=21254

参考链接

posted @ 2023-04-13 13:36  Feng1024  阅读(823)  评论(0编辑  收藏  举报