We need to change your password frequently from time to time from being hacked. While changing we have to enter old password and your desired new password and to confirm it we have to again enter the new password.
Program
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim ConnectionString As String = System.Configuration.ConfigurationSettings.AppSettings("dsn")
Dim con As OleDbConnection
Dim com As OleDbCommand
Dim oledbda As OleDbDataAdapter
Dim ds As DataSet
Dim str As String
Dim up As Byte
Private Sub btn_change_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_change.Click
If TextBox3.Text <> TextBox2.Text Then
MsgBox("confirm
password not matching with new passsword")
TextBox3.Focus()
Exit Sub
End If
Try
'If con.State = ConnectionState.Open Then
' con.Close()
'End If
con = New OleDbConnection(ConnectionString)
con.Open()
str = "select * from login"
com = New OleDbCommand(str, con)
Dim reader As OleDbDataReader = com.ExecuteReader
Do While reader.Read
If TextBox1.Text = reader("oldpwd") Then
up = 1
End If
Loop
If up = 1 Then
str = "update login set newpwd='" & TextBox3.Text & "' where oldpwd='" & TextBox1.Text & "'"
com = New OleDbCommand(str, con)
com.ExecuteNonQuery()


abdelrhman koutaPosted Aug 21, 2013, 2:18 PM
u make an database for it how to engaged it with windows to make change the password ??