Groups | Blog | Home
all groups > vb.net data > may 2006 >

vb.net data : install Access 2003 mdb to network


Beth
5/31/2006 12:02:01 PM
Hello.
I'm writing an application that, for now, uses an Access 2003 database.
If I install my application and the .mdb to c:\program files\vendor\app, it
works fine.

However, the data in the .mdb needs to be shared by multiple users, so I
want the .exe and .mdb on a network drive.

When I try to run the .exe from the network, it gives me an error:
Request for the permission of type 'System.Data.OleDb.OleDbPermission,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.

Is there something else I need to do to get a database open on a network
drive?

All help appreciated,

Beth
5/31/2006 1:14:02 PM
Jim,
Thanks for the response.
I can change my setup project back to installing the .exe on c:\, but the
..mdb is considered a content file, and it won't let me specify a network path.

So should the setup not install the .mdb, and I just copy it to the network
from my hard drive when it needs to get updated?

Then I have to figure out how to change the connection string so it includes
the network path...

This is a processor-intensive application, so we have a dedicated PC to run
the app, and the users can view the results. Access is fine for now, because
I can make schema changes, but eventually I expect we'll migrate to SQL
Server.

Thanks again for the pointers...

-Beth
[quoted text, click to view]
Jim Wooley
5/31/2006 7:31:21 PM
[quoted text, click to view]

You should be fine with just putting the database on the network drive. The
application should be installed on the client PC. You are running into issues
with Code Access Security by running the client on the network share. Remember
with an Access data store:

The user needs create/delete permissions on the network directory as a .ldb
file is created when the .mdb is accessed.
Access was not built to scale with many concurrent users. If only a handfull
are accessing it, you should be ok. It has problems as you add more users,
particularly if they are doing edits and not just viewing data.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.asp

Paul Clement
6/1/2006 3:25:03 PM
[quoted text, click to view]

¤ Jim,
¤ Thanks for the response.
¤ I can change my setup project back to installing the .exe on c:\, but the
¤ .mdb is considered a content file, and it won't let me specify a network path.
¤
¤ So should the setup not install the .mdb, and I just copy it to the network
¤ from my hard drive when it needs to get updated?
¤
¤ Then I have to figure out how to change the connection string so it includes
¤ the network path...
¤
¤ This is a processor-intensive application, so we have a dedicated PC to run
¤ the app, and the users can view the results. Access is fine for now, because
¤ I can make schema changes, but eventually I expect we'll migrate to SQL
¤ Server.
¤
¤ Thanks again for the pointers...
¤
¤ -Beth

I'm not sure what your connection string looks like but can't you just use the
network UNC path instead of a drive letter path?

I wouldn't install and run the app from the network if it isn't necessary. If
you do, each machine that runs this app will need to have its security policy
modified.

Paul
~~~~
Beth
6/2/2006 9:00:04 AM
Paul,
Thanks for the reply.
Yes, I changed the path to the mdb in the app.config file to the network
directory without using a drive letter, and changed the setup so it doesn't
install the content files, which include the .mdb.
I'll need to install changes to the .mdb by manually copying it to the
network.

The application itself is installed by default on c:\program
files\vendor\app\app.exe.

So we can run it on a dedicated PC (it takes a few hours to run) and open
the .mdb on the network to check the status.

Thanks again- that's the solution I was looking for.
One where we don't have to change the security policy on each of the clients.

-Beth
[quoted text, click to view]
Francis Winter
6/13/2006 8:57:17 PM
Hi! I have the same problem, my connection string is
System.Windows.Forms.Application.StartupPath & "\myDatabase.mdb" and I
placed the database on a network folder that is shared by everyone. My
original plan was to place the application and the database at the same
directory at the network folder and put a short-cut of the application
exe on everyones PC so that they could simply click that short-cut to
run the application on the network folder. But sadly, i encountered the
same problem Beth experienced. There would be ten users of that
application. And you stated that for everyone to run the application on
their computer, each machine should have their security policy modified.
How can we modify the security policy? thanks! :)





Beth
6/14/2006 7:10:03 AM
I was hoping they could add something to the setup projects that could do the
modifications as part of the install.

[quoted text, click to view]
Paul Clement
6/14/2006 11:17:16 AM
[quoted text, click to view]

¤ Hi! I have the same problem, my connection string is
¤ System.Windows.Forms.Application.StartupPath & "\myDatabase.mdb" and I
¤ placed the database on a network folder that is shared by everyone. My
¤ original plan was to place the application and the database at the same
¤ directory at the network folder and put a short-cut of the application
¤ exe on everyones PC so that they could simply click that short-cut to
¤ run the application on the network folder. But sadly, i encountered the
¤ same problem Beth experienced. There would be ten users of that
¤ application. And you stated that for everyone to run the application on
¤ their computer, each machine should have their security policy modified.
¤ How can we modify the security policy? thanks! :)
¤

See if the following helps:

How to deploy a .NET Framework application to run from a network location
http://support.microsoft.com/?kbid=832742

HOW TO: Build and Deploy a .NET Security Policy Deployment Package
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B815173


Paul
~~~~
AddThis Social Bookmark Button