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=Micr osoft.Jet.OLEDB .4.0;Data
Source = MyFile.xls;Exte nded Properties=Exce l 8.0;")
cnExcel.Open()
lookup = cnExcel.GetOleD bSchemaTable(Ol eDbSchemaGuid.T ables, Nothing)
Dim cmdExcel As New OleDbCommand("S ELECT * FROM [" &
lookup.Rows(0)( "TABLE_NAME ") & "]", cnExcel)
Dim dr As OleDbDataReader
dr = cmdExcel.Execut eReader
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=Micr osoft.Jet.OLEDB .4.0;Data
Source = MyFile.xls;Exte nded Properties=Exce l 8.0;")
cnExcel.Open()
lookup = cnExcel.GetOleD bSchemaTable(Ol eDbSchemaGuid.T ables, Nothing)
Dim cmdExcel As New OleDbCommand("S ELECT * FROM [" &
lookup.Rows(0)( "TABLE_NAME ") & "]", cnExcel)
Dim dr As OleDbDataReader
dr = cmdExcel.Execut eReader
If dr.Read Then
response.write( dr(0))
end if
dr.Close()
cnExcel.Close()
Thanks in advance,
Stu
Comment