' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Data.OleDb

Class MainClass
    Public Shared Sub Main(ByVal args As String())
        Dim con As OleDbConnection = New OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Database\MSAccess\Test.mdb;User Id=admin;Password=")
        con.Open
        Dim cmd As OleDbCommand = New OleDbCommand ("SELECT * FROM T1", con)
        Dim rdr As OleDbDataReader = cmd.ExecuteReader
        While rdr.Read
            Dim f1 As Integer = CType(rdr(0), Integer)
            Dim f2 As String = CType(rdr(1), String)
            Console.WriteLine(f1 & " " & f2)
        End While
        con.Close
    End Sub
End Class 
