03-10-2003, 03:44 PM
I am doing a project where I have a logon screen, and the values are then compared to a database with all usernames and passwords, but I am having some trouble understanding how to access the table in the database after I type in the password. How should I do this? The search will be triggered by a submit button, and the text from the UserID and the Password text boxes should then be compared to the database data in the table. How do I do this?... Thanks in advance! I need help!
03-10-2003, 06:48 PM
I often have to do this in projects so I use class modules, ie a Login class module that simply has UserID, UserName, and UserPassword properties. So when the user clicks the "submit" button the text in the username and password textboxes are transferred to the Username and UserPassword properties. I then open the database connection and perform a select statement with a WHERE clause using the UserName property. If a recordset is returned, ie there are records, then the UserName must exist. Thus, the username is valid. I then would check the UserPassword using another select statement, and if it finds the UserPassword that corresponds to the UserName then the login is valid, and I would open other forms, etc.
You should look into ADO as this contols such things as opening the data connection and retrieving a recordset.