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 :)

Recommended Answers

All 14 Replies

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.

commented: can you send me code to access the remote computer databse +0

No problem, glad you could solve this. Happy coding.:)

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!

plz can you explain how did you acheive this?

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

Can you share with us your solution Mr Mhamadh? regards

@mikeybware -2 Can you please Share your solution with me. i stuck in that same task.?

For me the solution has been: 1) set up a home group 2) add a network location: in "This PC" right click and selected that option and followed the wizard. 3) in my case, on the second PC I had to install MS Office Database Engine 2010 From Here
Note: on the wizard the location was "\\myServer\folder" this is, a location in 'This PC'. Of course, the database goes into that folder

@xrj . I appreciate your answere.But Similery I want to use this Functionality Over internet with Remote Computer's Static Ip Address with Port No.
Does there any way to accomlish that ? Having Single Ms Access database located in its local drive .

@dark.knight Let me suggest to you to start a new threat under Programming/Web Development/Asp.net, as this threat says it's been answered. Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.