I am currently developing in Visual Studio 2008 (Visual Basic) and I have no problem reading, editing, saving, etc. to a 2007 Access database that is stored locally using the following code:

Dim NotifyDS As New DataSet()
Dim NotifyCon As New OleDb.OleDbConnection
NotifyCon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Data\Settings.accdb"
NotifyCon.Open()

Ultimately I am going to be installing this program in my office on multiple computers, but would only like to have one "server" program where the database is installed. All of the other computers will have access to this one database over the LAN. For some reason I am unable to access this remote database file over my LAN. I have tried all sorts of things (including a username and password for the server computer), but will provide an example in hopes of a good starting point for help:

Dim NotifyDS As New DataSet()
Dim NotifyCon As New OleDb.OleDbConnection
NotifyCon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\MIKE-PC\SharingMike\Settings.accdb;Driver={Microsoft Access Driver (*.mdb, *.accdb};Persist Security Info=False"
NotifyCon.Open()

I have created a shared folder on MIKE-PC (called SharingMike) and set all priveledges (read/write/modify) to allow "everyone" access to it. And I still cannot get it to work.
Any help would be much appreciated :)

Edited 5 Years Ago by mikeybware: n/a

This is a VB.NET question. I have asked the mods to move it there.

As far as your question goes, try the following -

NotifyCon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\192.168.0.125\MIKE-PC\SharingMike\Settings.accdb;Driver={Microsoft Access Driver (*.mdb, *.accdb};Persist Security Info=False"

'Add the IP address of the server...

This is a VB.NET question. I have asked the mods to move it there.

As far as your question goes, try the following -

NotifyCon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\192.168.0.125\MIKE-PC\SharingMike\Settings.accdb;Driver={Microsoft Access Driver (*.mdb, *.accdb};Persist Security Info=False"

'Add the IP address of the server...

I have tried this as well, and still no luck. I get the error message "OleDbException was unhandled. Could not find installable ISAM."

After further reading I am beginning to understand that Access may not be the best for accessing a database over the Network or internet, and maybe SQL is a better choice. (If so, I have alot of work to do to convert my program over).

I have tried this as well, and still no luck. I get the error message "OleDbException was unhandled. Could not find installable ISAM."

After further reading I am beginning to understand that Access may not be the best for accessing a database over the Network or internet, and maybe SQL is a better choice. (If so, I have alot of work to do to convert my program over).

I think I am getting closer. My connection string is now:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\MIKE-PC\SharingMike\Settings.accdb;Persist Security Info=False

But I get the following error now: "The Microsoft Office Access database engine cannot open or write to the file '\\MIKE-PC\SharingMike\Settings.accdb'. It is already opened exclusively by another user, or you need permission to view and write its data."

I have set sharing on, and looked at the permissions, and the permissions are full ( read and write) ... not too sure why this message is coming up, but I am getting closer to accessing my MS Access database over my LAN.

I am sorry I can not help anymore. I am not that clued up on .NET. In VB6 it is quite easy though...:)

I have managed to find the following which might help.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\serverName\shareName\folder\myDatabase.mdb;User Id=admin;Password=;

Go to ConnectionStrings to find the connection that will work for you.

Another post found Here might help as well.:)

I have actually found a solution!! My ConnectionString was correct. I just needed a way to log into the remote computer to pass the username and password credentials for that server (to allow permissions), and a connectionstring does not allow for that. The username and password supplied in the ConnectionString are for the database itself.

What I ended up doing was creating an AliasAccount in my VB code and used impersonation to access the remote computer's database. Then voila! It worked!

Thanks for all of your help.

Edited 5 Years Ago by mikeybware: n/a

Comments
can you send me code to access the remote computer databse

I have actually found a solution!! My ConnectionString was correct. I just needed a way to log into the remote computer to pass the username and password credentials for that server (to allow permissions), and a connectionstring does not allow for that. The username and password supplied in the ConnectionString are for the database itself.

What I ended up doing was creating an AliasAccount in my VB code and used impersonation to access the remote computer's database. Then voila! It worked!

Thanks for all of your help.

plz can you explain how did you acheive this? and plz take into consideration that i am a novice so a step by step explannation and some sample code would be much appreciated :D
thanks!

Edited 3 Years Ago by m7amadh: lack of experience

plz can you explain how did you acheive this?

I have search 100 article but no solution .
If you have plz
Thanks

Edited 8 Months Ago by Arvind_3

Can you share with us your solution Mr Mhamadh? regards

Edited 4 Days Ago by Amouzigh

This question has already been answered. Start a new discussion instead.