Imports System.IO
Imports System.Data.OleDb.OleDbException
Public Class Form2
Inherits System.Windows.Forms.Form
Dim inc As Integer
Dim MaxRows As Integer
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim username As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click
con.ConnectionString = "PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source = E:\vasim\Cloun\database table\school.accdb"
con.Open()
If sql = "SELECT * FROM table1 WHERE Username ID and Password = 'UserName.text' ,'PassWord.text'" Then
MsgBox("login successfull")
Me.Hide()
Else
MsgBox("Incorrect Login Details - Please try again.")
End If
con.Close()
This is code for login form, while runnig this show msg "OledbExecption was unhandaled"