access2sql.zip
a 32-bit windows-command-line-applicationaccess2sql.exe -c=convert.ini
-key
=value or --key
=value or /KEY
=value format
Key | Default | Description | Example | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
i | input | file | mdb
| MS-Access-DB to connect to | this is the input database | File=c:\temp\db.mdb | ||||||||
o | output
| Standard Output | Where to output the sql-text | Output=c:\temp\db.sql | ||||||||
d | driver
| Microsoft Access Driver (*.mdb, *.accdb) | Name or the ODBC32 'driver' to use | Driver=Microsoft Access Driver (*.mdb) | ||||||||
u | user
| use this username when connecting to access-db | User=admin | |||||||||
p | password
| use this password when connecting to access-db | Password=secret | |||||||||
ts | timestamp
| (today) | can be used with %timestamp in sql | -ts=%_date (usually from command line) | ||||||||
ty | typ | type
| TAB/HEAD | type of output, se below for options | Type=INSERT IGNORE | ||||||||
s | sql
| sql to ask from the access-db | Sql=select * from table where created>=#%timestamp# | |||||||||
t | table
| table to use in sql-text-output | Table=table | |||||||||
f | field | fields
| * | fields to export to sql-text-output | Fields=col1,col3,col5... or Fields=1,2,4-8... | ||||||||
k | key | keys
| - (no keys) | field list, keys to skip in ON DUPLICATE KEY UPDATE format | Keys=id | ||||||||
bools |
INSERT INTO table (a,b,c..) VALUES (x,y,z..),(x,y,z..)..;
INSERT IGNORE INTO table (a,b,c..) VALUES (x,y,z..),(x,y,z..)..;
INSERT INTO table (a,b,c..) VALUES (x,y,z..),(x,y,z..).. ON DUPLICATE KEY UPDATE a=values(a)..;
## # File: Access2SQL.ini # [Config] Driver=Microsoft Access Driver (*.mdb) File=C:\Temp\db.mdb Output=C:\Temp\db.sql [Use] Type=APPEND SQL=USE sqldbname; [Table1] Type=INSERT DUPLICATE Sql=SELECT * FROM accesstable1 WHERE created>=#%timestamp#; Table=sqltable1 Keys=id,nr Bools=water Null=* [Table2] Type=INSERT DUPLICATE Sql=SELECT * FROM accesstable2; Table=sqltable2 Keys=id Null=* [Call] Type=APPEND SQL=CALL Procedure(%projid, '%timestamp');
Microsoft Access Driver (*.mdb, *.accdb)
driver is not installed by default (you need this to read the .accdb format)