Sheet's names
Hi,
I want to create a DataSet from an excel without knowing the name(s) of the sheets inside.
Is it possible to get the names of the sheets using OLE DB Provider ? So a I can perform several SELECT orders to get each sheets as a DataTable, then insert it into a DataSet.
If you know an easiet way to get a DataSet from an excel file, please do not hesitate.
Thank you.
Dadou
I want to create a DataSet from an excel without knowing the name(s) of the sheets inside.
Is it possible to get the names of the sheets using OLE DB Provider ? So a I can perform several SELECT orders to get each sheets as a DataTable, then insert it into a DataSet.
If you know an easiet way to get a DataSet from an excel file, please do not hesitate.
Thank you.
Dadou
Hi,
if you mean something like (my VB6 sample)
With ExcelConn
.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ExcelFileName & ";Extended Properties=""Excel 12.0;HDR=YES;IMEX=0;ParamCheck=False"""
.CursorLocation = adUseClient
.Open
Set ExcelSchema = .OpenSchema(adSchemaTables)
end with
-------------------------------------------------
i've solved with
note that ExcelSchema recordset contains now the n# of sheets and the sheet names are stored into ExcelSchema.Fields("TABLE_NAME").Value
----------------------------
Hope being of help...
By !
if you mean something like (my VB6 sample)
With ExcelConn
.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ExcelFileName & ";Extended Properties=""Excel 12.0;HDR=YES;IMEX=0;ParamCheck=False"""
.CursorLocation = adUseClient
.Open
Set ExcelSchema = .OpenSchema(adSchemaTables)
end with
-------------------------------------------------
i've solved with
note that ExcelSchema recordset contains now the n# of sheets and the sheet names are stored into ExcelSchema.Fields("TABLE_NAME").Value
----------------------------
Hope being of help...
By !
Selected Articles
