简体   繁体   English

读取远程MS Access数据库C#

[英]Read a remote MS Access database C#

I need to get a connection string from a remote location to access my MS Access database. 我需要从远程位置获取连接字符串以访问我的MS Access数据库。 I know you can do this like: 我知道您可以这样做:

OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Temp\\Testdatabase.accdb");

So I need to know how to access a file if it were hosted. 因此,如果文件托管,我需要知道如何访问该文件。 So the source would be http://somewebsite.com/Testdatabase.accdb 因此来源将是http://somewebsite.com/Testdatabase.accdb

How do I do this? 我该怎么做呢?

The answer is simple: You can't do this. 答案很简单:您不能这样做。

Access needs an SMB fileshare which you can't get from a web server. Access需要一个SMB文件共享,您无法从Web服务器上获取它。 Neither can you attach a database file from an FTP server, OneDrive, or DropBox. 您也无法从FTP服务器,OneDrive或DropBox附加数据库文件。

So either convert the remote database to a server engine like SQL Server or MySQL, or (if you only need to read) download the Access file to a local drive. 因此,要么将远程数据库转换为SQL Server或MySQL之类的服务器引擎,要么(如果您只需要阅读)将Access文件下载到本地驱动器。

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

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