如何使用C#查询远程的MS Access数据库的.mdb [英] How to query a remote MS ACCESS .mdb database using C#
问题描述
我想用C#查询微尘MS Access数据库的.mdb文件。将文件复制到我的本地机的时候我可以成功查询。我只想把远程文件,所以我的客户端程序不包含原始数据。
I am trying to use C# to query a mote MS ACCESS database .mdb file. I can successfully query it when copying the file to my local machine. I just want to put the file remotely, so my the client side program doesn't contain raw data.
static string m_path = "http://www.xyz.com/temp/";
static string m_connWords = "Provider=Microsoft.JET.OLEDB.4.0;data source = " + m_path + "data.mdb";
我跳过代码的其余部分做连接,读取和查询。
I skip the rest of code doing connection, reader, and query.
我相信,当我有我的m_path更改为本地MDB副本的本地路径,它的工作原理。我可以使用的URL路径时,所以正确指定的URL路径下载mdb文件。任何人都知道如何我缺少的是什么?
I am sure when I have my m_path change to a local path for a local mdb copy, it works. And I can download the mdb file when using the url path, so the url path is specified correctly. Anyone know how what I am missing?
感谢
推荐答案
您无法通过HTTP连接到接入数据库。你需要通过文件共享UNC(\server\share\access.mdb)来访问它。
You can't connect to an access database via HTTP. You'll need to access it via a file share UNC (\server\share\access.mdb).
这篇关于如何使用C#查询远程的MS Access数据库的.mdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!