简体   繁体   English

将Microsoft Access连接到phppgadmin以在PostgreSQL中查询

[英]Connect Microsoft Access to phppgadmin to query in PostgreSQL

My goal is to import data into Microsoft Access to create a database which I can reference from an excel dashboard for analysis. 我的目标是将数据导入Microsoft Access以创建一个数据库,我可以从excel仪表板中引用该数据库进行分析。

I can't find any information on how to connect access to allow me to query the database on phpPgAdmin. 我找不到有关如何连接访问权限的任何信息,从而无法在phpPgAdmin上查询数据库。

Any advice, direction or solution is highly appreciated. 任何建议,方向或解决方案均受到高度赞赏。

Please let me know if there more details are necessary. 如果需要更多详细信息,请告诉我。

MS Access is a multifaceted thing as many tend to conflate and confuse its frontend GUI .exe application and the distinct backend database (JET/ACE SQL engine which are Windows .dll files). MS Access是一个多方面的东西 ,许多人倾向于混淆和混淆其前端GUI .exe应用程序和独特的后端数据库(JET / ACE SQL引擎,它们是Windows .dll文件)。 Most of the time we refer to its MS Office app. 大多数情况下,我们指的是其MS Office应用程序。 Technically, MS Access is really the same type of product as phppgadmin: a GUI console to a database, only its default database is the aforementioned engine but can also integrate other ODBC/OLEDB-connected backends including Postgres, Oracle, MySQL, SQL Server, etc. 从技术上讲,MS Access与phppgadmin实际上是同一类型的产品:数据库的GUI控制台,仅其默认数据库是上述引擎,但也可以集成其他ODBC / OLEDB连接的后端,包括Postgres,Oracle,MySQL,SQL Server,等等

Through various means, you can integrate MS Access as a medium between PostgreSQL and Excel without any single migration (export/import) of data. 通过各种方式,您可以将MS Access作为PostgreSQL和Excel之间的媒介进行集成,而无需任何数据迁移(导出/导入)。

  1. Linked Tables - Directly connect to Postgres tables using its ODBC Driver . 链接表 -使用其ODBC驱动程序直接连接到Postgres表。

    链接表图标

  2. Pass-through queries - Create saved queries using Postgres dialect within MS Access. 传递查询 -使用MS Access中的Postgres方言创建保存的查询。

    直通查询

  3. ADO Connections (see Importing data programmatically and by using functions ) - Bypass MS Access and have Excel connect directly to Postgres also using OLEDB provider or ODBC driver. ADO连接 (请参阅以编程方式和通过使用函数导入数据 )-绕过MS Access,并使用OLEDB提供程序或ODBC驱动程序使Excel直接连接到Postgres。 Below is the programmatic version showing two connection string examples, but you can save connection objects via the Excel ribbon UI. 下面是显示两个连接字符串示例的编程版本,但是您可以通过Excel功能区UI保存连接对象。

     Dim strConnection ' REFERENCE Microsoft ActiveX Data Objects, #.# Library Dim conn As ADODB.Connection, rst As ADODB.Recordset ' ODBC AND OLEDB CONNECTIONS (SELECT ONE) strConnection = "Driver={PostgreSQL};Server=IPaddress;Port=5432;" _ & "Database=myDataBase;Uid=myUsername;Pwd=myPassword;" strConnection = "Provider=PostgreSQL OLE DB Provider;Data Source=myServerAddress;" _ & "location=myDataBase;User ID=myUsername;password=myPassword;" conn.Open strConnection rst.Open "SELECT * FROM myPGTable", conn 

    By the way, above is the VBA version to be run in an Excel macro but ADO is a COM object and hence can be integrated in COM-interfaced languages including PHP , Python, R, Java, etc. 顺便说一下,以上是要在Excel宏中运行的VBA版本,但是ADO是COM对象,因此可以集成到COM接口语言中,包括PHP ,Python,R,Java等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM