将Access转换为PostgreSQL? [英] Convert Access to PostgreSQL?

查看:120
本文介绍了将Access转换为PostgreSQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个客户端已经超出了他们的Access数据库,现在我需要将其转换为PostgreSQL。我没有太多的Access经验,所以乍一看似乎最好的解决方案是只使用文本文件或其他内容导出数据。

A client has outgrown their Access database, and now I need to convert it to PostgreSQL. I don't have a lot of Access experience, so at first blush it seems like the best solution is to just export the data using text files or something.

有人吗?有什么好的建议,可以方便地使DDL和数据脱离Access并变成真实的东西?

Does anyone have any good suggestions for an easy way to get the DDL and data out of Access and into something real?

推荐答案


  • 在Windows计算机上安装Postgres ODBC驱动程序。
  • 使用 PostgreSQL Unicode驱动程序为新数据库创建数据源
  • 对于每个表:

    • 使用文件- >导出,选择类型 ODBC数据库
    • 确认表名
    • 选择计算机数据源
    • 选择数据源

      • Install Postgres ODBC driver on Windows computer.
      • Create a data source with "PostgreSQL Unicode" driver to your new database
      • For every table:
        • Use "File -> Export" choose type "ODBC Databases"
        • Confirm table name
        • Choose "Computer data source"
        • Select your data source

          如果您没有太多表,效果很好。我需要使其自动化,所以我创建了一个VBS脚本,该脚本在适当的时间发出了键盘击键,如下所示:

          Works well if you do not have too many tables. I needed to automate this so I have created an VBS script which just issued keyboard strokes in proper time, like this:

          set shell=CreateObject("Wscript.Shell")
          shell.Run("db1.mdb")
          WScript.Sleep(5000);
          
          shell.sendkeys("tablename1");
          WScript.Sleep(1000);
          shell.sendkeys("%fx"); ' Menu File, Export
          WScript.Sleep(1000);
          shell.sendkeys("%todbc"); ' Type: ODBC Databases
          shell.sendkeys("~"); ' Enter
          

          等。

          这篇关于将Access转换为PostgreSQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆