How to query a remote MS ACCESS .mdb database using C#

不问归期 提交于 2019-12-20 07:24:18

问题


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.

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?

Thanks


回答1:


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).




回答2:


i think you have to some FTP upload n download temporary for that....

see this link

http://www.codeproject.com/KB/IP/SimpleFTPDemo.aspx

and when you put it in temp directory you got then local path.. of MS Access

OR

Open your "Client Panel" of website and make ODBC Driver/MS Access Database in that... see the information about how to connect Database MS Access in your SitePanel.

you can see there all the informations like How to... Mail Client Settings, MS Access Database Connection, MS SQL Database Connection, just for example in my domain panel i have this on ZNetPanel...

And then i think you knw how to connect ODBC !!



来源:https://stackoverflow.com/questions/5684474/how-to-query-a-remote-ms-access-mdb-database-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!