To perform batch conversion or call the conversion procedure from an automation script you can use console version of Access to SQL Server converter called A2MAGENT.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=... | SQL Server 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 SQL Server database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge) | |
--mssqlh=... | SQL Server server IP address or network name | |
--mssqlu=... | SQL Server user name | |
--mssqlp=... | SQL Server 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 SQL Server database "db1 from msaccess" on the remote SQL Server 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:
Table_1
Table_2
...
Table_N
Notes: