Académique Documents
Professionnel Documents
Culture Documents
OleDb
Public Class Form1
Dim conexion As New OleDbConnection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.E
ventArgs) Handles Button1.Click
If Val() = True Then
MessageBox.Show("Bienvenido-" + TextBox1.Text)
TextBox1.Text = ""
TextBox2.Text = ""
Form2.Show()
Else
MessageBox.Show("El nombre de usuario o contrasea no son validos")
TextBox1.Text = ""
TextBox2.Text = ""
ComboBox1.Focus()
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.Even
tArgs) Handles MyBase.Load
conexion.ConnectionString = "provider= microsoft.jet.oledb.4.0;data sour
ce = ..\DataBase.mdb"
End Sub
Public Function Val()
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
conexion.Open()
Dim da As New OleDbDataAdapter("select * from loginTable", conexion)
da.Fill(dt)
For Each datarow In dt.Rows
If TextBox1.Text = datarow.item(0) And TextBox2.Text = datarow(1) Th
en
If ComboBox1.Text = datarow(2) Then
conexion.Close()
Return True
End If
End If
{{codigos por Mario Castellanos SR--- gracias por descargar
Next
conexion.Close()
Return False
End Function
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.E
ventArgs) Handles Button3.Click
Form2.Show()
Me.Hide()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.E
ventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Imports System.Data.OleDb
Public Class Form2
Dim conexion As New OleDbConnection
Private Sub showitems()