问题
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