?
Solved

Working with Access database in non-shared folder

Posted on 2011-04-21
9
Medium Priority
?
258 Views
Last Modified: 2012-05-11
Is there a way to work with an Access database in a non-shared folder using a windows forms application as the front end? Want to prevent users from being able to directly access the database file, to prevent copying the whole database. (.accdb format) .
0
Comment
Question by:stakest
  • 5
  • 4
9 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35441390
Do the users have access rights to the folder? You can use the

\\computername\c$\folders....

path.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35441398
If users do not have direct permissions on the folder, you can create another user which has access to the folder and then use impersonation in your app to get to the folder.
0
 

Author Comment

by:stakest
ID: 35441590
Thanks for quick response. Right now, all users have a mapped drive on their local PC's pointing to the server where the .accdb file sits. All bus logic and UI is in the windows forms app. Issue is (even though the db is password protected) that as the folder on the server gives all the users read / write permissions, anyone can delete the database file, or copy it out. Want to set it up in such a way that the users dont have access to the Access db file.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35441621
Use Impersonation then

http://weblogs.asp.net/ralfw/archive/2003/11/24/39479.aspx


By the way, if the app is multiuser, why not use SQL Server? The express edition is FREE!
0
 

Author Comment

by:stakest
ID: 35441915
Sorry, I may be a bit slow on the uptake here :)

If I add the code as per above reference to allow the Impersonation, then only the new user I create would need to see the mapped network drive in the connection string, and I could remove the permissions for all other users to the folder? So, if part of my connection string has "Data Source=P:\...", if I remove the "P" map on all local desktops, the app will still work?

Re SQL server, will being looking at migrating sometime in the future.

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 35441954
You dont need to map the drive. You can change the connection string to a network path instead.

And yes, once you use the impersonated user to access the file, you can remove all other users' permissions and the program should work. However, I would suggest that you do a little test project first to see how it goes.
0
 

Author Comment

by:stakest
ID: 35442004
Thank you! I'll go ahead...hopefully wont need to come back with additional questions.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35442029
We are here to help if you have any additional questions :-)
0
 

Author Closing Comment

by:stakest
ID: 35442032
Will have to see if I can implement solution (based on suggested fix), but seems that it should solve the problem.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Beware when using the ListIndex and the Column() properties of a listbox in Access 2007.  A bug has been identified in the Access 2007 listbox code which can cause the .ListIndex property to return a -1, and the .Columns(#) property to return a NULL…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question