Dim strconnect As String = " provider=microsoft.Jet.Oledb.4.0;" & "Data Source= C:\Users\user\Documents\Visual Studio 2008\Projects\Unilife\Unilife\unilifedb.mdb"
Dim con As New OleDbConnection(strconnect)
Dim com As New OleDbCommand
Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim strsql As String = "SELECT * FROM inv WHERE inv_id between '" & Me.TextBox1.Text & "' and '" & Me.TextBox2.Text & "' "
con.ConnectionString = strconnect
With com
.Connection = con
.CommandText = strsql
.CommandType = CommandType.Text
End With
da.SelectCommand = com
da.Fill(ds, "table1")
dt = ds.Tables(0)
da = Nothing
con.Close()
con = Nothing