1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
Private Sub BtnAjout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAjout.Click
Dim custConn As OleDb.OleDbConnection = New OleDb.OleDbConnection(connectstr)
Dim mescomm As New OleDb.OleDbCommand
Dim readUtilisat As OleDb.OleDbDataReader
Dim Lemenup As New menup
Try
MonLogin = Trim(TextBox1.Text)
MonPassWord = Trim(TextBox2.Text)
'Teste du Super Administrateur
If MonLogin = "SuPerAdmin" And MonPassWord = "MonPassWord" Then
LaFonction = "Super Administrateur"
Lemenup.Show()
TextBox1.Text = ""
TextBox2.Text = ""
Else
MonPassWord = Trim(crypte(TextBox2.Text, "C"))
custConn.Open()
mescomm.Connection = custConn
mescomm.CommandType = CommandType.Text
mescomm.CommandText = "select typeutilisat,loginutilisat,passwordutilisat from UTILISATEUR where loginutilisat= '" & MonLogin & "' and passwordutilisat= '" & MonPassWord & "'"
readUtilisat = mescomm.ExecuteReader()
If readUtilisat.Read Then
LaFonction = Trim(readUtilisat!typeutilisat)
Lemenup.Show()
TextBox1.Text = ""
TextBox2.Text = ""
Else
MonCompteur = MonCompteur + 1
If MonCompteur = 3 Then
Me.Close()
Else
MsgBox("Revoyez votre login et votre mot de passe S.V.P. Il se peut que l'un soit erroné", MsgBoxStyle.OkOnly, "Vérification du Login et du Mot de passe")
TextBox1.Text = ""
TextBox2.Text = ""
End If
End If
End If
custConn.Close()
Catch
MsgBox(Err.Description)
Finally
End Try
End Sub |
Partager