From:       To:      
Home > Documentation > MS Access to PostgreSQL

Command Line Version of MS Access to PostgreSQL Converter

[MS Access to PostgreSQL Converter]  [Troubleshooting]  [Tutorial]

To perform batch conversion or schedule the procedure from an automation script, you can use console version of MS Access to PostgreSQL converter called A2PAGENT.EXE. Find this file in the installation folder. You can either run this tool directly from command line or call it from any script as well. The program supports the following command-line options:

--accp=...   MS Access database password
--dest=...   PostgreSQL database or script file
--dump   export MS Access data into PostgreSQL script file
--help   display help message and exit
--host=...   PostgreSQL server IP address or network name
--logfile=...   path to the logfile where execution traces will be written
--mode=...   how to process an existing PostgreSQL database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge)
--port=...   PostgreSQL port
--profile=...   path to a profile to load conversion settings from
--pswd=...   PostgreSQL user password
--silent   use this option to disable program output
--skip_idx   skip converting indexes
--src=...   MS Access database name
--sysdb=...   path to MS Access workgroup information file (*.mdw)
--tab_def   convert table definitions only
--tab_file=...   name of the file containing table names to convert (one table name per line)
--uglu=...   user name for MS Access user-level security
--uglp=...   password for MS Access user-level security
--user=...   PostgreSQL user name

In the following example the program converts MS Access database "db1" into PostgreSQL database "db1 from msaccess" on the remote PostgreSQL server "pgshost" using table names file "c:\tabfile1.txt":

A2PAGENT.EXE --src=c:\db1.mdb --dest="db1 from msaccess" --host=pgshost 
--user=scott --pswd=tiger --tab_file=c:\tabfile1.txt

Table names file is a text file containing one table name per line:

Table_1
Table_2
...
Table_N

Notes: