VOOZH about

URL: https://www.cdata.com/kb/tech/postgresql-odbc-access-linked-tables.rst

โ‡ฑ How to Use a Microsoft Access Database to Update PostgreSQL Data in Real Time


How to Use a Microsoft Access Database to Update PostgreSQL Data in Real Time

๐Ÿ‘ Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Update PostgreSQL data by creating a linked table in Microsoft Access with the CData PostgreSQL ODBC Driver.

CData ODBC drivers connect your data to any database management tool that supports Open Database Connectivity (ODBC). This includes many of the most popular productivity tools, adding new capabilities for document sharing and collaboration. Using the CData ODBC driver for PostgreSQL, you can update live PostgreSQL data in Microsoft Access; for example, you can make updates that can be immediately seen by other users.

Connect to PostgreSQL as an ODBC Data Source

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.

To connect to PostgreSQL, set the Server, Port (the default port is 5432), and Database connection properties and set the User and Password you wish to use to authenticate to the server. If the Database property is not specified, the data provider connects to the user's default database.

SSH Connectivity for PostgreSQL

You can use SSH (Secure Shell) to authenticate with PostgreSQL, whether the instance is hosted on-premises or in supported cloud environments. SSH authentication ensures that access is encrypted (as compared to direct network connections).

SSH Connections to PostgreSQL in Password Auth Mode

To connect to PostgreSQL via SSH in Password Auth mode, set the following connection properties:

  • User: PostgreSQL User name
  • Password: PostgreSQL Password
  • Database: PostgreSQL database name
  • Server: PostgreSQL Server name
  • Port: PostgreSQL port number like 3306
  • UserSSH: "true"
  • SSHAuthMode: "Password"
  • SSHPort: SSH Port number
  • SSHServer: SSH Server name
  • SSHUser: SSH User name
  • SSHPassword: SSH Password

SSH Connections to PostgreSQL in Public Key Auth Mode

To connect to PostgreSQL via SSH in Password Auth mode, set the following connection properties:

  • User: PostgreSQL User name
  • Password: PostgreSQL Password
  • Database: PostgreSQL database name
  • Server: PostgreSQL Server name
  • Port: PostgreSQL port number like 3306
  • UserSSH: "true"
  • SSHAuthMode: "Public_Key"
  • SSHPort: SSH Port number
  • SSHServer: SSH Server name
  • SSHUser: SSH User name
  • SSHClientCret: the path for the public key certificate file

Create a Linked Table to Orders Data

Follow the steps below to create a linked table, which enables you to access live Orders data.

  1. On the External Data tab in Access, click ODBC Database. ๐Ÿ‘ Use the Get External Data wizard to work with ODBC data sources in Access.
  2. Select the option to link to the data source. A linked table will enable you to read from and write data to the Orders table. ๐Ÿ‘ Linked Tables enable you use the live connection to PostgreSQL that is provided by the driver.
  3. Select the CData PostgreSQL data source from the Machine Data Source tab.

    ๐Ÿ‘ DSNs listed in the Get External Data wizard.
  4. Select the Orders table. For more information on this table, see the "Data Model" chapter in the help documentation. ๐Ÿ‘ Available tables. (Google is shown.)
  5. Double-click the linked table to make edits. The linked table will always have up-to-date data and any changes will be reflected back to the underlying table.

    ๐Ÿ‘ A linked table to the live data. (Google is shown.)

Ready to get started?

Download a free trial of the PostgreSQL ODBC Driver to get started:

 Download Now

Learn more:

๐Ÿ‘ PostgreSQL Icon
PostgreSQL ODBC Driver

The PostgreSQL ODBC Driver is a powerful tool that allows you to connect with live PostgreSQL data, directly from any applications that support ODBC connectivity.

Access PostgreSQL databases from virtually anywhere through a standard ODBC Driver interface.