简体   繁体   English

使用openrow集将访问表导入到MS sql

[英]Import Access Table to MS sql using openrow set

Im trying to import an access table to sql using openrowset function. 我试图使用openrowset函数将访问表导入到sql中。 I can get it to work with excel but have not manged to get it working with Access. 我可以使它与excel一起使用,但还没有使其与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? 您的代码是针对Excel的,也许如果您发布了迄今为Access尝试过的代码但未能成功运行,这会有所帮助吗?

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. 请注意,您需要提供用户名/密码以及文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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