help: extracting Execel tables with ADO without reordering them

  • Thread starter Thread starter Lucia
  • Start date Start date
L

Lucia

I'm trying to find a way to extract all the worksheets
(tables) from an Excel workbook and having them returned
in the same order in which they're originally defined in
the workbook (not alphabetically).

The VB.net instruction used is:

tables = ccn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
New Object() {Nothing, Nothing, Nothing, "TABLE"})


Is there any other way (like query, etc.) to get all the
tables?

Thanks,
Lucia
 
...
I'm trying to find a way to extract all the worksheets
(tables) from an Excel workbook and having them returned
in the same order in which they're originally defined in
the workbook (not alphabetically).

None I know of. ADO classic's OpenSchema method can be used to return
a recordset of schema info for Excel 'tables' but again in
alphabetical order of name. An Excel table can be a worksheet or a
worksheet- or workbook-level defined Name; you must parse the name to
remove define Names e.g.

http://groups.google.com/[email protected]

Note the TABLE_GUID for an Excel data source is always null, however
the DATE_CREATED field may be of some use to you.

BTW I'm guessing ADO lacks this functionality because tables in a
'normal' DBMS aren't considered to have ordinal positions.

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top