Dear fan2006, our honored newuser.
Great thanks for your theoretical efforts. But your code is not working at all. Anybody can get only OLEexception with it. Please try to improve your pure theory, at least you should:
- change OLE variant of 'rst' to 'ADODB.RecordSet';
- forget 'rst.fields.count' as unsupported for RecordSet method;
- your 'fields('TABLE_TYPE').value' can return only one - '(TABLE)', so it is totally not necessary;
Please improve your knowlege before the next answering.
Dear colleague devEric69,
your recommendations are good enough, but in a real case are needed only three parameters:
Provider=Microsoft.Jet.OLEDB.4.0;
Extended Properties=Excel 8.0;
Data Source=...;
It really works with it! Thanks a lot!
Resume to all:
IMHO, Microsoft doesn't pay his attention on GetTableNames according to Excel workbook using as SQL Data Source. I will try to check if GetFieldNames demonstrate the same kind of behavior... Maybe I'd change ODBC access to OLE simulation. God knows...