Imports System Imports System.Data Imports System.Data.OleDb Imports Microsoft.VisualBasic Public Class pass Private cnx As OleDbConnection, cmd As OleDbCommand, dta As OleDbDataAdapter, dts As New DataSet, dtt As New DataTable, sql As String, cnxstr As String, cmdb As OleDbCommandBuilder Private Sub pass_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cnxstr = "provider=microsoft.jet.oledb.4.0;data source=" & Application.StartupPath & "\shopping.mdb;" cnx = New OleDbConnection cnx.ConnectionString = cnxstr cnx.Open() sql = "select * from Security" cmd = New OleDbCommand(Sql) dta = New OleDbDataAdapter(cmd) dts = New DataSet cmd.Connection() = cnx dta.Fill(dts, "Security") dtt = dts.Tables("Security") TextBox2.PasswordChar = "*" Menu11.Show() Menu11.Enabled = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text "" Or TextBox2.Text "" Then MsgBox("Please Type your Login and Password", MsgBoxStyle.OkOnly, "Attention") ElseIf Me.TextBox1.Text dtt.Rows(0).Item("login") And Me.TextBox2.Text dtt.Rows(0).Item("password") Then Me.Close() Menu11.TopMost = True Menu11.Enabled = True Else TextBox1.Text = "" TextBox2.Text = "" MsgBox("Please Try A Gain", MsgBoxStyle.OkOnly, "Attention") End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Menu11.Close() End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question