Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Set user permissions VB.net datagridview.

Posted on 2014-01-16
6
Medium Priority
?
1,019 Views
Last Modified: 2014-01-30
I'm creating a small application in VB that pulls its data from an MS Access database. The data goes to a datagridview in vb.net.

I want to know if its possible to create some sort of user account database in the application or in MS Access?

In the end I want to be able to have the user login and depending on the permissions give them read only or write access in the datagridview.
0
Comment
Question by:AnthonySmithMCP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 85
ID: 39786487
Access 2003 and earlier could use User Level Security. It can be tricky to setup and use, and for your purposes (controlling permissions to your .NET DataGridView control) would not be the best way to go.

Why not just add a User table, and then query that table as needed? For example:

tUsers
-------------
UserId
UserName
UserPassword
CanWrite

The "CanWrite" field would be used to determine if the user can write to the datagridview.

To validate the login, create a form to capture the user and pass, then compare that to the one stored in the database. If the passwords match, then also grab the value of CanWrite and store that in a variable named something like "bCanWrite"

When your form opens, do something like this:

YourDataGridView.ReadOnly = Not bCanWrite
0
 
LVL 1

Author Comment

by:AnthonySmithMCP
ID: 39786536
Scott,

That is what I was thinking but I'm new to database programming. On thing that sticks out is what is stopping someone from going into that user account table and viewing the login/password information? Can a master password be set on the database?
0
 
LVL 14

Expert Comment

by:Matti
ID: 39786594
hi

In old Access there where able to use DBEngine to open database against systemsm.mdw-file there where multiple accounts for users and permissions to individual objects in database. Thats obsolete now DAO. set NTFS permissions for users to use your application.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:AnthonySmithMCP
ID: 39786607
NTFS permissions is an option but not the best because some users are not domain users.

I was going with using a table in access but need to know if its possible to set a master password on the database to prevent users from just going to the table to view the usernames/passwords.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 39786658
Yes, you can set a database password. Not sure how you're creating the database, but if you're using Access 2010 then just open the database in Access, click the File option, and then use the "Encrypt with Password" feature.

Your connection string would be something like:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccessFile.accdb;
Jet OLEDB:Database Password=MyDbPassword;

See here: http://www.connectionstrings.com/access/
0
 
LVL 1

Author Comment

by:AnthonySmithMCP
ID: 39786666
Trying now...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

618 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