Excel's ODBC driver's field limit
I'm not aware of any work-arounds other than simply breaking up your query into two or more
(depending on how many fields there are) so that the field list is below the limit. Most database
"scientists" would say that a table with over 256 columns is probably poorly designed.
If you're using CRecordset (the MFC class), you're probably catching a CDBException, which has
m_nRetCode, m_strError, m_strStateNativeOrigin members, and the GetErrorMessage method. Please
explain what "a more abstract way" would mean to you.
"Jo" wrote in message
oups.com...
I'm trying to import this Excel file using the Excel ODBC driver, but
its failing on this one file that has at least 256 columns. The error
message is "{ODBC Excel Driver] Too many fields defined." The statement
I'm using to perform the query is SELECT * `<table name` WHERE 1. Is
this a problem of * being too many columns? Is there anyway around
this, such as making the connection read-only, or forward scrolling
only, or any other restrictions that I can live with? Read-only and
forward scrolling are 2 such restrictions.
Also, how do I identify the error code returned? Right now I'm
getting -1040 as an error, but is there a more abstract way of
detecting this error? I'm developing under VC++6.0, btw, so I might not
be using the same environment as you.
|