Solved

Design question

Posted on 2000-04-01
5
128 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
5 Comments
 
LVL 3

Accepted Solution

by:
Foyal earned 15 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now