0

I have two pc lined up connected to each other using WAN.

I have shared the folder containing an Access Database and the i give permission to Everyone for everything on the database itself.

Now the Code i am using is:

string connectionString = string.Empty;
connectionString  = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\winPcDemo-570f\abcd\testDB.mdb; Jet OLEDB:Database Password=**********;";
OleDbConnection tmpconnection = new OleDbConnection(connectionString);

tmpconnection.Open(); // ERROR 

But this comes up with an error:

Disk or network error.

Its unlike to any to other question on this site so that is why i am posting this.

5
  • Are users able to access \\winPcDemo-570f\abcd\testDB.mdb from explorer? May 31, 2013 at 16:41
  • 1
    No they re not that's what is troubling me as i can access folders on my pc from winPcDemo-570f.
    – confusedMind
    May 31, 2013 at 16:42
  • do you have read and execute privileges?
    – MUG4N
    May 31, 2013 at 16:43
  • I thought there is something wrong with connection string or some other way to connect!
    – confusedMind
    May 31, 2013 at 16:46
  • Stop using access, SQL Express is free and you can import Access to SQL without any issues. If you have access forms or reports etc. which use this database create linked tables to your SQL store via ODBC connections. Access was awesome in it's time, it's reporting was revol
    – LordWabbit
    Aug 3, 2013 at 13:17

2 Answers 2

0

It would be helpful if you tried accessing \\Macbookpro-570f\abcd\ from explorer to check if there is a problem with the network or share setup. (Update your answer with the result).

My first thought though is permissions. Access requires sufficient permissions to create its .ldb file in the same folder as well as being able to modify the .mdb file. Windows shares have 2 sets of permissions that apply. First is the permissions on the share, second is the actual NTFS permissions on the file / folder. You need to ensure that BOTH of these permission sets grants the correct user sufficent permissions to modify the mdb and create the ldb.

2
  • I give full control to everyone on the folder and the database still same issue.
    – confusedMind
    May 31, 2013 at 16:43
  • @confusedMind - sorry to repeat myself, but you gave everyone full control both on the folder and on the share? Also, what about accessing the network share from explorer? Can both PCs access the network share?
    – pipTheGeek
    Jun 5, 2013 at 11:18
0

I would try mapping the path to a drive letter. Go to the command prompt (might need to open as administrator) and do the following:

net use q: \\winPcDemo-570f\abcd mypassword /USER:myaccount

(mypassword and my account should be your credentials if necessary. You can use another drive letter besides q if necessary also.)

Then, you can use

Data Source=Q:\testDB.mdb

instead of

Data Source=\\winPcDemo-570f\abcd\testDB.mdb

I think it should work the way you've specified, but perhaps this would allow you to rule out whether its a code issue or an OS/privilege issue.

Hope this helps!

1
  • Mapped drives are the way to go, using UNC paths adds a lot of permission issues. When you offload the security authentication to a mapped drive it resolves a lot of issues when working with access databases. That being said, stop using access, SQL Express is free and you can import Access to SQL without any issues. If you have access forms or reports etc. which use this database create linked tables to your SQL store via ODBC connections. Access was awesome in it's time, it's reporting was revol
    – LordWabbit
    Aug 3, 2013 at 13:17

You must log in to answer this question.