Imports System.Data.OleDb
Public Class Form2
 Dim a As String
 Dim baglantı As New OleDb.OleDbConnection
 Dim kon As Boolean = False
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 a = Convert.ToString(TextBox1.Text)
 
 If kontrol(TextBox1.Text, TextBox2.Text) = True Then
 MsgBox("HOŞGELDİNİZ... BY " & a, MsgBoxStyle.Information, "HOŞGELDİNİZ")
 Form1.Show()
 Me.Hide()
 Else
 End If
 End Sub
 Public Function kontrol(ByVal ad As String, ByVal sifrex As String) As Boolean
 Dim baglantı As New OleDbConnection
 baglantı.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\login.accdb"
 Dim commad As New OleDb.OleDbCommand
 commad.CommandText = "SELECT * FROM kontrol WHERE kullanıcı_adı=@kullanıcı_adı "
 commad.CommandType = CommandType.Text
 commad.Connection = baglantı
 Dim paremert As New OleDbParameter("@kullanıcı_adı", DbType.String)
 paremert.SourceColumn = "kullanıcı_adı"
 paremert.Value = ad
 commad.Parameters.Add(paremert)
 Dim sifrepa As New OleDbParameter("@sifre", DbType.String)
 sifrepa.SourceColumn = "sifre"
 sifrepa.Value = sifrex
 commad.Parameters.Add(sifrepa)
 Dim oku As OleDbDataReader
 baglantı.Open()
 oku = commad.ExecuteReader
 Do While oku.Read = True
 If oku.Item("kullanıcı_adı") = ad And oku.Item("sifre") = sifrex Then
 kon = True
 Exit Do
 End If
 Loop
 If kon = True Then
 Return True
 ElseIf kon = False Then
 MsgBox("HATALI GİRİŞ YATINIZ", MsgBoxStyle.Critical, "UYARI")
 TextBox1.Clear()
 TextBox2.Clear()
 TextBox1.Focus()
 Return False
 TextBox1.Focus()
 End If
 baglantı.Close()
 End Function
 
 
End Class
İnanmayan, Şaka yaptığımı düşünenlerde denesin
bakın sonra nasıl kontrol ediyo
 
				
				
			
 
			

