简体   繁体   中英

Import Access Table to MS sql using openrow set

Im trying to import an access table to sql using openrowset function. I can get it to work with excel but have not manged to get it working with Access. I've a load of tables which would be time consuming to do via wizard. This is the code I have so far

select * into input_2013.[sample] from openrowset('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=W:\Projects\Sample.xlsx;HDR=yes', 'SELECT * FROM [sheet1$a2:t]');

Your code is for Excel, maybe if you posted the code you had tried so far for Access and not managed to get working it would help?

You could try something along these lines:

SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'W:\Projects\test.mdb';'admin';'', MyData);

Note that you need to provide a username/ password as well as the file name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM