Hello Everyone
I am new using VB2005 and I need some assistance with the following:
I have a created a program that connects to a Access database, the user has to have a user name and password to be able to access the application. So far that is working correctly it validates to make sure that the user and password does exist in the logon table.
As you know sometimes people forget their passoword and the administrator has to reset it. I have setup a default password when ask to be reset it which is "Support".
If someone logs in using their logon and the temporary passoword (Support) the system is going to promt the user to change it.
I would like for the validation of the temporary password not for just anyone to use someone elses logon and just type "Support" and promt them to change it. how can i make sure that the password has been reset.
I have the following code:
Thanks you so much for your helpCode:Dim testsearch_connection As OleDbConnection Dim searchtable_string As String = "" 'Dim searchtable_string2 As String = "" If Trim(UsernameTextBox.Text) = "" Then InvalidEntry("User Name") Exit Sub End If If Trim(PasswordTextBox.Text) = "" Then InvalidEntry("User Password") Exit Sub End If 'If PasswordTextBox.Text = "support" Then 'MessageBox.Show("The Password you entered has expired, please change it now.", "Change Password", MessageBoxButtons.OK) 'Me.PasswordTextBox.ResetText() ' ResetPasswordForm.Show() ' Exit Sub ' End If testsearch_connection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\program files\Support Desk\Database\SupportDesk.mdb;Persist Security Info=False") testsearch_connection.Open() Dim myAdapter As New OleDb.OleDbDataAdapter searchtable_string = "SELECT logon, test FROM assignee Where logon='" & UsernameTextBox.Text & "' and test='" & HashPassword(PasswordTextBox.Text) & "'" Dim myCommand As New OleDb.OleDbCommand() myCommand.Connection = testsearch_connection myCommand.CommandText = searchtable_string 'start query myAdapter.SelectCommand = myCommand Dim myData As OleDb.OleDbDataReader myData = myCommand.ExecuteReader() 'see if user exits. If myData.HasRows = 0 Then 'MessageBox.Show("Invalid Login Details", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error) MsgBox("User name/password invalid", MsgBoxStyle.Critical) Else Dim frm1 = New Form Searchfrm.Show() Me.Visible = False End If




Reply With Quote