I just want to create a login program. My problem is how can I connect VB to MSAccess and what is the code I'll use to verify the username and password that was stored in database (MSAccess)?
It is just a simple login program having ten accounts stored in the database.
____________________________
Beginner...
24-03-2006 at 03:42 AM
|
GeoffS Level: VB Lord Registered: 29-09-2004 Posts: 536
All you need then is a table in the database with UserName and Password fields. Create a Form in VB with 2 textboxes - (UserName and Password) and a button marked "LogIn". Then in the button_Click Event connect to your Database and open a recordset based on your Users table. The best way would be with a SQL Query with a "WHERE" clause that looks for a match between what your users type into the Form and whats in the table.
Dim strCNN As String
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strPath As String
Dim strPASS As String, strName As String, strSQL As String