title: Using Access to store Usernames and Passwords and opening via Visual Basic
body: <p>Basically i am trying to create a programme, which needs to have some authorisation. </p>
  
  <p>When the application starts up, it starts straight into the login screen.</p>
  
  <p>I want the Username and Password textboxes to read the database and if they match then progress to the next form but if they dont match then a message box will appear.</p>
  
  <p>I also want to create groups of people so if a certain group of people log in they go to a certain form and if the another group of people log in i want them to go to a different form.</p>
  
  <p>Also i want the password box to be <em>*</em> instead of visable text.</p>
  
  <p>Can any one help, this is my code so far...</p>
  
  <p>dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
          dbSource = "Data Source = D:/Users.mdb"</p>
  
  <pre><code>    con.ConnectionString = dbProvider &amp; dbSource
  
      con.Open()
  
  
      sql = "SELECT * FROM tblUsers"
      da = New OleDb.OleDbDataAdapter(sql, con)
      da.Fill(ds, "Users")
  
      con.Close()
  
      MaxRows = ds.Tables("Users").Rows.Count
      inc = -1
  
  
      If UserIDTextBox.Text = ds.Tables("tblUsers").Rows(0).Item("UserID") &amp; User_PasswordTextBox.Text = ds.Tables("tblUsers").Rows(0).Item("Password") Then
          MsgBox("This have worked correctly!")
      Else
          MsgBox("This has not worked, try again!")
      End If
  </code></pre>