Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Windows.Forms
- Imports System.Data.Odbc
- Imports System.Data.DataTable
- Imports System.Data.DataSet
- Public Class windows
- Dim myCmd As New OdbcCommand
- Dim connect As OdbcConnection
- Dim usrname As String
- Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Me.Close()
- End Sub
- Private Sub changePass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles changePass.Click
- On Error GoTo HandleErrors
- connectMe()
- If txtnew_pass.Text & txtconfirmPass.Text = "" Then
- MessageBox.Show("Please fill up the form", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning)
- Else
- Dim Password As String
- Dim confirmedpwd As String
- Password = txtnew_pass.Text.Trim
- confirmedpwd = txtconfirmPass.Text.Trim
- If Password <> confirmedpwd Then
- MessageBox.Show("your password is not matched")
- Else
- connectMe()
- With myCmd
- .Connection = Con
- .CommandText = " update users set Password = '" & Password & "' where username = '" & usrname & "'"
- .ExecuteNonQuery()
- txtnew_pass.Enabled = True
- txtconfirmPass.Enabled = True
- txtnew_pass.Focus()
- End With
- txtnew_pass.Enabled = False
- txtconfirmPass.Enabled = True
- txtnew_pass.Focus()
- MessageBox.Show(" Password has been change")
- txtnew_pass.Clear()
- txtconfirmPass.Clear()
- txtnew_pass.Focus()
- Refresh()
- End If
- End If
- HandleErrors:
- 'MsgBox(Err.Number)
- If Err.Number = 5 Then
- MsgBox("Error: duplicate password" & Err.Number)
- End If
- End Sub
- Public Property userName() As String
- Get
- Return usrname
- End Get
- Set(ByVal value As String)
- usrname = value
- End Set
- End Property
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement