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 = '" & strUser & "' "
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt)
If dt.Rows.Count > 0 Then
Me.lblUser.Text = strUser
Me.lblName.Text = dt.Rows(0)("Name")
Me.lblEmail.Text = dt.Rows(0)("Email")
End If
objConn.Close()
objConn = Nothing