Author Topic: How to C# form connects remote Access database?  (Read 1234 times)

0 Members and 1 Guest are viewing this topic.

ekoneo

  • Newt
  • Posts: 66
How to C# form connects remote Access database?
« on: October 30, 2021, 06:58:35 AM »
I made many researches. I watch many sample. But all of them shows the connection with local database with a connection string:
Code: [Select]
OleDbConnection con = new OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0;Data Source = \\C ......
I need very simple thing. Getting only a string data. Not more. I am beginner. So I tried these:
Code: [Select]
OleDbConnection con = new OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0;Data Source =\\158.137.129.105\App_Data\sample_db.accdb");and
Code: [Select]
OleDbConnection con = new OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0;Data Source =\\http://www.abc.net\App_Data\sample_db.accdb");But I get error about connection string format.
Is it possible to geting a string from remote access database?
Thanx.

n.yuan

  • Bull Frog
  • Posts: 348
Re: How to C# form connects remote Access database?
« Reply #1 on: October 30, 2021, 08:17:04 AM »
It is a network issue: the remote location must in the same network as where your/user computer sits. If the remote location is not part of your intranet, it has be reachable as if it is part of the intranet, for example, via VPN. Also, even the access file is located in a a network folder of the same intranet, you/user must be given proper permission to access it. You'll need an network expert to look your network setup to see how or if possible to access the remote location.

Also, directly connect even MS Access in your local drive from AutoCAD, well doable, might not be good option, considering the need to install 64-bit MS Access DB engine.