Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Go Back  Xtreme Visual Basic Talk > > > Login system with multiple user access levels from Access Database


Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2013, 01:49 AM
Solar Dragon Solar Dragon is offline
Newcomer
 
Join Date: Feb 2013
Posts: 11
Default Login system with multiple user access levels from Access Database


Hello,
I have been working on a quiz project which requires a login system. I have three user rights: Admin, Teacher and Pupil. Each user needs to see a different screen after logging in. I am not 100% sure on how to do this so any help would be great.

My current code for my login system is this:
Code:
Public Class loginform
    Dim passwordtrials As Integer
    Dim usernameresult As String
    Dim LoginTableConnection As OleDbConnection
    Dim LoginCommand As OleDbCommand
    Dim LoginAdapter As OleDbDataAdapter
    Dim LoginTable As DataTable
    Dim LoginManager As CurrencyManager
    Dim UserAccess As String
    Dim LoginInfoCommand As OleDbCommand


    Private Sub loginform_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        LoginTableConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = C:\AssesmentProgram\SchoolAssessments.mdb")
        LoginCommand = New OleDbCommand("SELECT * FROM LoginInfo ORDER BY Username")
        LoginAdapter = New OleDbDataAdapter()
        LoginAdapter.SelectCommand = LoginCommand
        LoginTable = New DataTable()
        LoginAdapter.Fill(LoginTable)


        UsernameTxt.DataBindings.Add("Text", LoginTable, "Username")
        PasswordTxt.DataBindings.Add("Text", LoginTable, "Password")

        LoginTableConnection.Open()

        LoginManager = DirectCast(Me.BindingContext(LoginTable), CurrencyManager)

    End Sub

    Private Sub CancelBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancelBtn.Click

        Me.Close()

    End Sub

    Private Sub LoginBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBtn.Click
        Call Login()
    End Sub

    Private Sub Login()

        LoginInfoCommand = New OleDbCommand("SELECT * FROM LoginInfo WHERE Username = '" & UsernameTxt.Text & "' AND Password = '" & PasswordTxt.Text & "' ", LoginTableConnection)

    End Sub

    Private Sub PasswordTxt_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasswordTxt.TextChanged
        PasswordTxt.PasswordChar = "*"c

    End Sub
End Class
In my Database table, named "LoginInfo", I have a field called "UserAccess", which holds the names "Admin", "Teacher" and "Pupil". After logging in, I need to make each user access go to a different screen.

If you need to see a screenshot of my form, just ask. I have to text boxes, one for Username and one for Password, and I have two buttons, Login and Cancel.

If you need any more information to help me, just ask and I'll provide you with anything else you need.

Thanks in advance.
Reply With Quote
  #2  
Old 03-12-2013, 08:47 AM
torpkevuk's Avatar
torpkevuk torpkevuk is offline
Contributor
 
Join Date: Oct 2003
Location: Nebraska, USA
Posts: 640
Default

What exactly is it you aren't sure of? How to display a different screen for each?

Should be as easy as if Admin then (open admin page) - if Teacher (open teacher page) if pupil (open pupil page)

I'm not sure if you're having a hard time with the database aspect, or creating/showing the new page?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
 
Login system with multiple user access levels from Access Database
Login system with multiple user access levels from Access Database
 
-->