1
Answer

How to connect to MS-Access database from another computer in LAN ?

Photo of hellopeat

hellopeat

20y
7.7k
1
anyone can help me ? i want to have 1 database (ms-access) on server computer (just to keep the database file) And i will write 3 windows applications to access the data on that database (access from the other computer on Local Area Network) Question: Is it possible to use MS-Access ? If yes , How to do it ? (such as how to set the database server (use ms-access), how to write the connetion string to connect the database, ... ) thanks

Answers (1)

0
Photo of ytram5
NA 135 0 20y
Yes, it is possible. For it to work though, whichever username the program is run under must have access to this other computer. If not, then the program will not have access rights to the database file. Here is a general connection string: "provider=Microsoft.Jet.OLEDB.4.0;data source=[path to mdb file]"; Since the mdb file is located on another computer in your network, you must use UNC paths(or you could map a network drive, but UNC would be better). Here's an example, assuming the computer name is COMP_NAME, and the file is located in c:\database\db1.mdb on COMP_NAME. "provider=Microsoft.Jet.OLEDB.4.0;data source=\\COMP_NAME\c$\database\db1.dmb"; You could also set up a shared folder on COMP_NAME named Database, and the string would look like this: "provider=Microsoft.Jet.OLEDB.4.0;data source=\\COMP_NAME\Database\db1.dmb"; A share would probably be the best bet, as you can set permissions on just that share, rather than giving access to the whole root. This won't be an issue if the programs will be running under an admin's username.
Next Recommended Forum