使用 MS Access 和 ODBC 连接到远程 PostgreSQL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using MS Access & ODBC to connect to a remote PostgreSQL
提问by Guy C
I currently have an MS Access application that connects to a PostgreSQL database via ODBC. This successfully runs on a LAN with 20 users (each running their own version of Access). Now I am thinking through some disaster recovery scenarios, and it seems that a quick and easy method of protecting the data is to use log shippingto create a warm-standby.
我目前有一个通过 ODBC 连接到 PostgreSQL 数据库的 MS Access 应用程序。这在具有 20 个用户的 LAN 上成功运行(每个用户运行自己的 Access 版本)。现在我正在思考一些灾难恢复场景,似乎一种快速简便的数据保护方法是使用日志传送来创建热备份。
This lead me to think about putting this warm-standby at a remote location, but then I have the question:
这让我想到将这个热备份放在一个偏远的地方,但后来我有一个问题:
Is Access connecting to a remote database via ODBC usable?I.e. the remote database is maybe in the same country with ok ping times and I have a 1mbit SDSL line.
Access 通过 ODBC 连接到远程数据库是否可用?即远程数据库可能在同一个国家,ping 时间正常,我有一条 1mbit SDSL 线路。
回答by
onnodb,
onnodb,
The PostgreSQL ODBC driver is actively developedand an Access front-end combined with PostgreSQL server, in my opinion makes a great option on a LAN for rapid development. I have been involved in a reasonably big system (100+ PostgreSQL tables, 200+ Access forms, 1000+ Access queries & reports) and it has run excellently for a few years, with ~20 users. Any queries running slow because Access is doing something stupid can generally just be solved by using views, and any really data-intensive code can easily be moved into PostgreSQL functions and then called from Access.
PostgreSQL ODBC 驱动程序正在积极开发中,Access 前端与 PostgreSQL 服务器相结合,在我看来是在 LAN 上进行快速开发的绝佳选择。我参与了一个相当大的系统(100 多个 PostgreSQL 表、200 多个 Access 表单、1000 多个 Access 查询和报告)并且它已经运行了几年,有大约 20 个用户。任何由于 Access 正在做一些愚蠢的事情而运行缓慢的查询通常都可以通过使用views来解决,并且任何真正的数据密集型代码都可以轻松地移动到 PostgreSQL 函数中,然后从 Access 中调用。
The only main ODBC-related issue we have is that there is no way to kill a slow running query from Access, so we do often get users just killing Access and then massive queries are just left executing on the server.
我们遇到的唯一与 ODBC 相关的主要问题是无法从 Access 中终止运行缓慢的查询,因此我们经常让用户只是终止 Access,然后大量查询只在服务器上执行。
回答by Joe Barone
Yes.
是的。
I don't have any experience using Access to hit PostgreSQL from a remote location but I have successfully used Access as a front-end to SQL Server & DB2 from a remote location with success.
我没有使用 Access 从远程位置访问 PostgreSQL 的任何经验,但我已经成功地使用 Access 作为前端到 SQL Server & DB2 从远程位置成功。
Ironically, what you don't want to do is use Access to front-end an Access database (mdb) from a remote location over a high-latency link. Since hitting the MDB uses file-based operations it's pretty easy to end up with a corrupt database if you have anything more than a trivial db.
具有讽刺意味的是,您不想做的是使用 Access 从远程位置通过高延迟链接对 Access 数据库 (mdb) 进行前端处理。由于命中 MDB 使用基于文件的操作,因此如果您拥有的不仅仅是一个微不足道的 db,则很容易以损坏的数据库告终。
回答by onnodb
It depends a loton the database you're using as a back-end. I've had rather terrible experiences with MySQL as a back-end. Make sure the ODBC link you're using is actively developed, stable and complete --- this was definitely not the case for MySQL. You may also want to check for any compatibility issues between Access and Postgre. And, of course, it won't hurt to test extensively.
这取决于一个很多你使用作为后端数据库上。我在使用 MySQL 作为后端时有过相当糟糕的经历。确保您正在使用的 ODBC 链接是积极开发的、稳定的和完整的——这对于 MySQL 来说绝对不是这种情况。您可能还想检查 Access 和 Postgre 之间是否存在任何兼容性问题。而且,当然,广泛测试不会有什么坏处。
Oh, and I think it'd be absolutely great if you could post back here later with your experiences!
哦,我认为如果您稍后可以将您的经验发回这里,那将是非常棒的!
回答by onnodb
PostgreSQL works great as a backend for MS Access, there are a couple of support functions you should use to make things easier. See here for more info on this:
PostgreSQL 非常适合作为 MS Access 的后端,您应该使用一些支持功能来简化操作。有关更多信息,请参见此处:

