good day!

we are currently creating a library system which includes a forgot password module..
but we are having difficulties in retrieving the passwords from our database.
could someone help us .. thank you in advance.
here is the code we've done..
-------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
003 | If ComboBox1.Text = "" Or TextBox1.Text = "" Or TextBox2.Text = "" Then |
004 | MessageBox.Show( "Invalid Username and Password!" , "Invalid" , MessageBoxButtons.OK, MessageBoxIcon.Warning) |
007 | ComboBox1.Text = "Select" |
011 | ElseIf ComboBox1.Text = "Administrator" Then |
012 | Static iPassCount As Integer ' this will assure that the counter is visible only locally but not lost from call to call |
013 | If TextBox1.Text = "admin" And TextBox2.Text = "nimda" Then |
014 | Dim log As New LoginForm |
016 | iPassCount = 0 ' If passwor is ok then reset the counter |
020 | iPassCount += 1 ' increase the counter |
022 | If iPassCount < 4 Then ' while less than 3 retries notify the user |
024 | MessageBox.Show( "Invalid Username and Password for " & vbNewLine & ( " Administrator" ), "Invalid" , MessageBoxButtons.OK, MessageBoxIcon.Warning) |
026 | Else ' almost 3 times failed to enter the password |
027 | If MessageBox.Show( "Do you want to retrieve your password?" , "Forgot Password" , MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.Yes Then |
028 | Dim fp As New ForgotPassword |
040 | ElseIf ComboBox1.Text = "Librarian" Then |
042 | Static iPassCount1 As Integer |
043 | If TextBox1.Text = "librarian" And TextBox2.Text = "librarian" Then |
044 | Dim log As New LoginForm |
045 | iPassCount1 = 0 ' If password is ok then reset the counter |
049 | iPassCount1 += 1 ' increase the counter |
050 | If iPassCount1 < 4 Then ' while less than 3 retries notify the user |
051 | MessageBox.Show( "Invalid Username and Password for " & vbNewLine & ( " Librarian" ), "Invalid" , MessageBoxButtons.OK, MessageBoxIcon.Warning) |
053 | If MessageBox.Show( "Do you want to retrieve your password?" , "Forgot Password" , MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.Yes Then |
054 | Dim fp As New ForgotPassword |
063 | ElseIf ComboBox1.Text = "User" Then |
065 | Static iPassCount2 As Integer |
066 | Dim connection As New OleDbConnection |
067 | Dim userpassquery As New OleDbCommand |
068 | Dim datareader As OleDbDataReader |
071 | If TextBox1.Text = "" Or TextBox2.Text = "" Then |
072 | MsgBox( "Please enter a Username and Password!" ) |
075 | connection.ConnectionString = connectionString |
076 | userpassquery.CommandText = "SELECT Username, LastName FROM Registration WHERE Username= '" & TextBox1.Text & "';" |
079 | userpassquery.Connection = connection |
081 | datareader = userpassquery.ExecuteReader |
086 | 'Check if username is in the database |
090 | If datareader.HasRows = True Then |
091 | 'Check if password is correct |
094 | 'Determine level of access |
099 | iPassCount2 = 0 ' If password is ok then reset the counter |
103 | iPassCount2 += 1 ' increase the counter |
104 | If iPassCount2 < 4 Then ' while less than 3 retries notify the user |
105 | MessageBox.Show( "Invalid Username and Password for " & vbNewLine & ( "User" ), "Invalid" , MessageBoxButtons.OK, MessageBoxIcon.Warning) |
107 | If MessageBox.Show( "Do you want to retrieve your password?" , "Forgot Password" , MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.Yes Then |
108 | Dim SecretQuestion As New OleDbCommand |
109 | Dim connection1 As New OleDbConnection |
110 | Dim datareader1 As OleDbDataReader |
113 | ' almost 3 times failed to enter the password |
114 | Dim strName As String |
117 | strName = InputBox( "Please enter your Username" , "Retrieve" ) |
119 | Dim secret As New ForgotPassword |
120 | Dim SecretAnswer As String |
124 | connection1.ConnectionString = connectionString |
125 | SecretQuestion.CommandText = "SELECT SecretQuestion FROM Registration WHERE Username= '" & strName & "';" |
126 | SecretAnswer = "SELECT SecretAnswer FROM Registration WHERE Username= '" & strName & "';" |
130 | 'forgot password label and textbox. please see the forgot password :) |
132 | ForgotPassword.Label3.Text = SecretQuestion.CommandText |
133 | ForgotPassword.TextBox2.Text = SecretAnswer |
135 | SecretQuestion.Connection = connection1 |
136 | datareader1 = SecretQuestion.ExecuteReader |
140 | connection1.Dispose() |