Jump to content

VB question


houssam_ballout

Recommended Posts

hello all,well I am doing a project on VB, and I want to create a login window that would give the admin (with special username and password) more privilege than the normal user (other username and password)?Also,for that purpose, Do I need to create multiple forms, in which when entering admin user name I will access the admin form, or what????anybody for help and suggestions.thanks

Link to comment
Share on other sites

I'm gonna assume that because you used the term 'form' that you're doing this in Visual Basic 6 and not VBScript.Since I don't really know what you're familiar with in Visual Basic in terms of database development, I'm gonna go with the assumption that you don't know a whole heck of a lot. (Not meaning to insult your intelligence! :) )A login would for an admin would be handled the same as any login. The user types in their name and password and then the appropriate form is shown. Now what you can do is set a single user name and password as exclusive. What this means is that they are two variables pre-defined in your program. So when the user types in their user name and password, you can check it against the admin user name and password. If they match the pre-defined user name and password, you show the admin screen. If not, then you show the regular user screen. Actually for all intents and purposes, you would want to unload the admin forms from memory if the user were a regular user and vice versa. If this doesn't help, let me know.

Link to comment
Share on other sites

  • 3 weeks later...

yes you can do it what ever you choose admin name and password add a constant text by which identify this is admin and transfer to admin page example:in databaseyou have users : name passwords sree 123456 --> user(no text prior) paul password2 --> user(no text prior) adminproject1 adminpasswordx --->admin user (you have text "admin" prior to username and password)in vb code:normally user enters username and password then you will code apage to search that username and password exist in database or not if exist transfer the page to user privillage page ,if doesn't exist then you need to add "admin" text prior to username and password which provided by user and search database again.definately you will find a record (if u provide right username password)in that case you transfer the page to admin.in this situation rememeber that if you enter username and password with the prior text "admin" you will transfer to user privillage page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...