OleDb取数问题
请各位帮忙看看为啥下面的代码只能取到满足条件的数量,不能取到满足条件的整体数据
将取到数据放在excel sheet1表中
Dim Conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFilePath & ";Extended Properties=Excel 8.0;"
Dim OleDbConnection As OleDb.OleDbConnection = New OleDb.OleDbConnection(Conn)
Dim sql As String = "SELECT * FROM [产量$] where 产量 > 0"
Dim OleDbDataAdapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(sql, Conn)
Dim dt As New DataTable
OleDbDataAdapter.Fill(dt)
book.Sheets("sheet1").["a1"].value = dt.DataSet.Tables
[解决办法]
这个excel的头几行也是和下面的列完全一样的吗?