I have been searching around but can't find anything to answer this. I'm trying to query data form excel xls file with a VB.Net winform to pass result for rest of app but I'm stuck here.
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
Dim total As Integer
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Reports\SOFL-mployee_Support.xls;Extended Properties=Excel 8.0"
cmd.Connection = con
cmd.CommandText = "Select Count(Sr Id) from [SOFL-Employee_Support$] Where [Status]=Closed"
total = CInt(cmd.ExecuteScalar)
Trying to read file, worksheet and query results. If I could just get data into msgbox I could take it from here, Problem with above code is in debug mode it just exits at con.Open no error, but might be something with my syntax. Done a few queries with sql but not much with oledb, unless there is a easier way.