' 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=C:\Book3.xls;Extended Properties=""Excel 8.0;HDR=No;IMEX=1""")
        con.Open
        Dim cmd As OleDbCommand = New OleDbCommand("Select f2,f3 FROM [sheet1$] WHERE f1 >= 2", con)
        Dim rdr As OleDbDataReader = cmd.ExecuteReader
        While rdr.Read
            Dim k2 As Double = CType(rdr(0), Double)
            Dim k3 As Double = CType(rdr(1), Double)
            Console.WriteLine(k2 & " " & k3)
        End While
        con.Close
    End Sub
End Class 
