Jump to content

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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...