Microsoft.ACE.OLEDB.12.0,远程服务器上的数据源 [英] Microsoft.ACE.OLEDB.12.0, data source on remote server

查看:290
本文介绍了Microsoft.ACE.OLEDB.12.0,远程服务器上的数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我试图以这种方式从excel文件中读取



< pre lang =sql> SELECT *
FROM OPENROWSET
' Microsoft.ACE.OLEDB.12.0'
' Excel 12.0;数据库= C:\test.xls'
' SELECT * FROM [sheet1 $]'
);





一切正常。文件'test.xls'在本地服务器上



我在远程服务器上的文件有问题

我该如何解决?







提前感谢!

解决方案

'
);





一切正常。文件'test.xls'在本地服务器上



我在远程服务器上的文件有问题

我该如何解决?







提前感谢!


用于MS Excel * .xls文件使用正确的连接字符串 [ ^ ]。



如需了解更多信息,请参阅: Excel数据导入SQL Server的基础知识 [ ^ ]


string excelConnString = String.Format(Provider = Microsoft.Jet.OLEDB.4.0; Data Source = {0}; Extended Properties =Excel 12.0;,filePath);



指定文件路径如果您的服务器名称是testserver, - > \\testserver\excelltest.xlsx

Hi guys,

I am trying to read from excel file in this way

SELECT *
FROM OPENROWSET(
      'Microsoft.ACE.OLEDB.12.0'
    , 'Excel 12.0;Database=C:\test.xls'
    , 'SELECT * FROM [sheet1$]'
);



all works fine. the file 'test.xls' is on local server

I have problems with files that are on remote server
how can I fix?



thanks in advance!

解决方案

' );



all works fine. the file 'test.xls' is on local server

I have problems with files that are on remote server
how can I fix?



thanks in advance!


For MS Excel *.xls files use proper connection string[^].

For further information, please see: The Basics of Excel Data Import to SQL Server[^]


string excelConnString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties="Excel 12.0";", filePath);

specify the filepath if your server name is testserver, -> \\testserver\excelltest.xlsx


这篇关于Microsoft.ACE.OLEDB.12.0,远程服务器上的数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆