J
John
I am attempting to retrieve records from an .mdb file. But can only
retrieve the first entries of the table using the code below. How would I
code to get any entry I desired (2nd entry, 4th entry, etc.) ?
Code:
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\Name\Desktop\History.mdb;")
'provider to be used when working with access database
cn.Open()
cmd = New OleDbCommand("select * from MainTable", cn)
dr = cmd.ExecuteReader
While dr.Read()
' loading data into TextBoxes by column index
TextBox1.Text = dr(0) 'Scrape
TextBox2.Text = dr(1) 'Amount
End While
Catch
End Try
dr.Close()
cn.Close()
Main Table is the name of my table, Scrape is the name of my first field,
Amount is the name of my second field. They are both number data types.
retrieve the first entries of the table using the code below. How would I
code to get any entry I desired (2nd entry, 4th entry, etc.) ?
Code:
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\Name\Desktop\History.mdb;")
'provider to be used when working with access database
cn.Open()
cmd = New OleDbCommand("select * from MainTable", cn)
dr = cmd.ExecuteReader
While dr.Read()
' loading data into TextBoxes by column index
TextBox1.Text = dr(0) 'Scrape
TextBox2.Text = dr(1) 'Amount
End While
Catch
End Try
dr.Close()
cn.Close()
Main Table is the name of my table, Scrape is the name of my first field,
Amount is the name of my second field. They are both number data types.