Hi,

I've never really created a login screen in VB and connected it to a table in MS Access before. So I'm supposed to create a login screen and after gaining access to it, a main menu form needs to show up which would be connected to the rest of the forms.
I'm having trouble in finding the right code for the login screen but then again, I dont know what I'm exactly supposed to do. Like I wanna connect the login form using the ADODC option but i'm just really confused.

I'd appreciate it if anyone could help me out.
Thanks for your time! :)

Are you using VB6 ?
First of all get rid of the Data control.
Never use the Data Environment.
Never use Data Controls
Don't use binding.

Add a bas file to your project, and make it the startup object (Sub Main)
Show the Login form VBModal.
The login form can have textboxes for user to enter their Name and Password, and you can check if they correctly exist in the DB.
You could have declared a public flag bLoggedIn as Boolean, and the Form can set that to True if the user succeeded.
If the user correctly enters the password, you can close the Login form, and set it to nothing (Setting to nothing should be done in that Sub Main, as the code execution will return to the line immediately after the line that showed the form VBModal.)
When code execution returns to the Sub Main, you can check that flag, and then show your other form(s).

Yes, I'm using VB6.
And I cant get rid of Data Control because my whole project works cuz of that and secondly, it's a requirement for my assignment. Um, I HAVE to connect the Login screen to the Login table in Access cuz that's an other requirement. :\

  1. accept login credential from UI.
  2. check the same in the DB. (select count(*) from user_table where user_id = "user_id" and password = "password" ). ensure user_id is unique/priamy key.
  3. if it matches (if count = 1 then)proceed further
  4. else re-prompt for credential.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.