S
Stu
Hi,
I am using the following code to read the data from an Excel spreadsheet. It
runs basically OK but it skips the first row of the spreadsheet. Does anyone
know how to either read the first line or (*hack warning*) insert a blank
record in the first line of the worksheet....?
Dim cnExcel As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source = MyFile.xls;Extended Properties=Excel 8.0;")
cnExcel.Open()
lookup = cnExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim cmdExcel As New OleDbCommand("SELECT * FROM [" &
lookup.Rows(0)("TABLE_NAME") & "]", cnExcel)
Dim dr As OleDbDataReader
dr = cmdExcel.ExecuteReader
If dr.Read Then
response.write(dr(0))
end if
dr.Close()
cnExcel.Close()
Thanks in advance,
Stu
I am using the following code to read the data from an Excel spreadsheet. It
runs basically OK but it skips the first row of the spreadsheet. Does anyone
know how to either read the first line or (*hack warning*) insert a blank
record in the first line of the worksheet....?
Dim cnExcel As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source = MyFile.xls;Extended Properties=Excel 8.0;")
cnExcel.Open()
lookup = cnExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim cmdExcel As New OleDbCommand("SELECT * FROM [" &
lookup.Rows(0)("TABLE_NAME") & "]", cnExcel)
Dim dr As OleDbDataReader
dr = cmdExcel.ExecuteReader
If dr.Read Then
response.write(dr(0))
end if
dr.Close()
cnExcel.Close()
Thanks in advance,
Stu