From:       To:      

Home > Documentation > MS Access to MS SQL

Command line version of MS Access to MS SQL converter

To perform batch conversion or call the conversion procedure from an automation script you can use console version of Access-to-MSSQL A2MAGENT.EXE. Find this file in Access-to-MSSQL 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=...   MS SQL database name
--help   display help message and exit
--logfile=...   path to the logfile where execution traces will be written
--mode=...   how to process an existing MS SQL database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge)
--mssqlh=...   MS SQL server IP address or network name
--mssqlu=...   MS SQL user name
--mssqlp=...   MS SQL user password
--profile=...   path to a profile to load conversion settings from
--script   export MS Access data into T-SQL script file
--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

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

A2MAGENT.EXE --src=c:\db1.mdb --dest="db1 from msaccess" --mssqlh=mssqlhost 
--mssqlu=administrator --mssqlp=the_passsword --tab_file=c:\tabfile1.txt

Table names file should be formatted as follows:



  1. If you specified a profile, there is no need to specify any other parameters
  2. You should omit 'sysdb', 'uglu' and 'uglp' parameters if not use MS Access user-level security
  3. You can omit 'mssqlh' parameter to connect local MS SQL server
  4. You can omit 'mssqlu' and 'mssqlp' parameters to connect to MS SQL server using Windows authentication
  5. If you omit 'tab_file' parameter, all database tables will be converted
  6. If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
  7. Command line parameters that contain spaces should be enclosed in quotes (for example --dest="my database")