Command Line
To perform batch conversion or call the conversion procedure from an automation script you can use console version of MSSQL-to-Access M2AAGENT.EXE. Find this file in MSSQL-to-Access 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:
| --acc_ver=... |
format version for the destination MS Access database
(0 - MS Access 95/97, 1 - MS Access 2000) |
| --dest=... |
MS Access database name |
| --help |
display help message and exit |
| --mode=... |
how to process an existing MS Access 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 |
| --skip_idx |
skip converting indexes |
| --src=... |
MS SQL database name |
| --tab_def |
convert table definitions only |
| --tab_file=... |
name of the file containing table names to convert (one table name per line) |
In the following example the program converts MS SQL database "db1" on the remote MS SQL server "mssqlhost" to MS Access 2000 database "c:\db1_from_mssql.mdb" using table names file "c:\tabfile1.txt":
M2AAGENT.EXE --src=db1 --dest=c:\db1_from_mssql.mdb --mssqlh=mssqlhost --mssqlu=administrator --mssqlp=the_passsword --tab_file=c:\tabfile1.txt --acc_ver=1
Table names file should be formatted as follows:
Table_1
Table_2
...
Table_N
Notes:
- You can omit 'host' parameter to connect local MS SQL server
- You can omit 'mssqlu' and 'mssqlp' parameters to connect to MS SQL server using Windows authentication
- If you omit 'tab_file' parameter, all database tables will be converted
- If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
|