Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim objConn As New OleDbConnection
Dim objCmd As New OleDbCommand
Dim dtAdapter As OleDbDataAdapter
Dim dt As New DataTable
Dim strConnString, strSQL As String
Dim directory As String = My.Application.Info.DirectoryPath
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & directory & "\database.mdb;Jet OLEDB:Database Password=;"
objConn.ConnectionString = strConnString
objConn.Open()
strSQL = "SELECT * FROM member WHERE Username = '" & Me.txtCode.Text & "' AND Name = '" & Me.txtName.Text & "' "
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt)
If dt.Rows.Count > 0 Then
Me.lblUser.Text = dt.Rows(0)("User")
Me.lblName.Text = dt.Rows(0)("Name")
Me.lblEmail.Text = dt.Rows(0)("Email")
End If
objConn.Close()
objConn = Nothing
End Sub