1. The connection string is the easy one.
Provider=Microsoft.ACE.OLEDB.12.0;Data ource=<path to file>\database.accdb;Persist Security Info=False; .
2. It depends. If you know that more than one record will be returned, then storing them in a DataTable would be good.
From there you can browse each record by the simple use of an index value.
3. Then that's what you should go with.
4. This is an example for locating and storing the results in a DataTable.
Imports System.Data.OleDb
Private table1 As DataTable
Private Sub SearchDatabase()
Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data ource=<path to file>\database.accdb;Persist Security Info=False;"
Dim connection As New OleDbConnection(connectionString)
Dim adapter As New OleDbDataAdapter()
Dim command As OleDbCommand()
Try
connection.Open()
If txtBoxSingleDate.Text.Equals("") Then
command = New OleDbCommand("SELECT * FROM table1 WHERE [Date] BETWEEN '" & txtBoxDate1.Text & "' AND '" & txtBoxDate2.Text & "'", connection)
Else
command = New OleDbCommand("SELECT * FROM table1 WHERE [Date] = '" & txtBoxSingleDate.Text & "'", connection)
End If
table1 = New DataTable("table1")
adapter.Fill(table1)
connection.Close()
Catch ex As Exception
End try
End Sub