I just knocked up this example, which uses the northwind database. The text
box will display Nancy ( one of the employees ) hope this helps.
Dim ConStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;Data
Source=..\Northwind.mdb;User Id=admin;Password="
Dim SelectString As String
Dim Con As New OleDb.OleDbConnection
Dim SelectCmd As New OleDb.OleDbCommand
Dim Da As New OleDb.OleDbDataAdapter
Dim Table As New DataTable
SelectString = "SELECT * FROM EMPLOYEES"
SelectCmd.CommandText = SelectString
SelectCmd.Connection = Con
Da.SelectCommand = SelectCmd
Con.ConnectionString = ConStr
Try
Con.Open()
Da.Fill(Table)
Catch ex As OleDb.OleDbException
MessageBox.Show(ex.Message)
Finally
Con.Close()
End Try
Me.TextBox1.Text = Table.Rows(0).Item(2).ToString()
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me
Time flies when you don't know what you're doing
"Stephen" <sw******@notmail.com> wrote in message
news:OA**************@TK2MSFTNGP14.phx.gbl...
I'm looking for the simplest example of VB.net to read/write a minimal MS
Access.database. Something like put date in textbox1, click button1, get
rainfall total in textbox2. For updates, fill in textboxes 1&2 and click
button2 to store new data in Access.
No creating classes or objects. Just a clean, quick and dirty example so I
can figure this out. Many Thanks.