Solved

Design question

Posted on 2000-04-01
5
144 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

739 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