Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Design question

Posted on 2000-04-01
5
Medium Priority
?
154 Views
Last Modified: 2010-05-02
Hello. I need to design an app that will allow different users access to different objects. Upon users Login program should know what he / she can access. Certain users will be able to modify data others will just be able to view it. How can i allow this ? Data is stored in Access. Please suggest . Thank  you.
0
Comment
Question by:vbRetard
[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
5 Comments
 
LVL 3

Accepted Solution

by:
Foyal earned 60 total points
ID: 2676121
Add a table for the users with an access code field, then when your program runs verify each process according to this access code.

i.e.:

Option Explicit

Dim intUserCode As Integer
Const FULL_ACCESS = 5

Private Sub Form_Load()
   
    frmLogin.Show vbModal, Me

    'load the user code from the
    'database based on the user name
    intUserCode = GetUserCode(UserName)

End Sub    

Private Function GetUserCode(S As String) As Integer
     
    'your code to get the code...

End Function

Private Sub cmdAdd_Click()
   
    'if the user isn't qualified then
    'show a message and exit the sub
    If intUserCode < FULL_ACCESS Then
        MsgBox "Access Denied"
        Exit Sub
    End If
   
    'otherwise, do whatever you
    'need to do...

End Sub

0
 
LVL 2

Expert Comment

by:arikka
ID: 2676273
Below is brief description of a good design and Microsoft recommendation ...

Your application is 3-tier should be  
3 tier application.  

1. Presentation VB code;
2. Business Logic components
3. Data Components - access DB

Use MTS as components placeholder, so
BL components and Data Components put
in MTS. Use MTS role base security to
restrict access to Data Components specific users or users groups.
0
 

Author Comment

by:vbRetard
ID: 2676713
MTS is a bit too advanced for me right now. I need something simpler. To create a class object which can do something like this. I don't need anyone post the code just ideas on how i can validate or lock different portions of the program to the person who shouldn't have access to it.
0
 
LVL 4

Expert Comment

by:gcs001
ID: 2677280
Foyal's suggestion is a good one.
0
 
LVL 3

Expert Comment

by:Foyal
ID: 2716794
Thanks for the point.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 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