Imports System.Data.OleDb
Imports System.IO
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim w As StreamWriter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
w = File.AppendText("c:\1test1.txt")
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\1\tt.mdb;")
cn.Open()
cmd = New OleDbCommand("select * from DATA_COUNTER", cn)
dr = cmd.ExecuteReader
While dr.Read()
TextBox1.Text = dr(1)
TextBox3.Text = dr(4)
w.WriteLine(dr(1) & " " & dr(4))
dr.Close()
cn.Close()
w.Close()
End While
Catch
End Try
End Sub