The information in this article applies to:
SYMPTOMS
In Microsoft Excel, you can use the Xlodbc.xla add-in macro functions to
return data from an external source to your worksheet. The XLODBC macro
functions SQLRetrieve and SQLRequest may not behave as expected if you
attempt to return more than 248 columns of data. If the SQLExecQuery
function is used to create a query, this function will correctly return the
number of columns in the data set resulting from the query even if this
number exceeds 248.
In Microsoft Excel 5.0 for Windows NT, Microsoft Excel 5.0 for the Macintosh, Microsoft Excel 7.0 for Windows 95 and Microsoft Excel 97, if you use SQLRetrieve or SQLRequest to return more than 248 columns of data, you will receive only the first 248 columns of the result set but you will not receive an error. WORKAROUND
To work around this problem, use any of the following methods.
You cannot return more than 248 columns of data to Microsoft Excel using the Xlodbc.xla macro functions unless you execute two separate queries--one query to return the first 248 columns and another query to return the remaining columns.Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspMethod 2: Using Xlquery.xla You can use the Microsoft Query add-in to return more than 248 columns. The macro below demonstrates an example.
Method 3: Using Data Access Objects (DAO) in Microsoft Excel 7.0 and 97
You can use DAO to return more than 248 columns. The macro below demonstrates an example. To use DAO in a Microsoft Excel 7.0 macro, click References on the Tools menu while the module sheet is active and select Microsoft DAO 3.0 Object Library. To use DAO in a Microsoft Excel 97 macro, click References on the Tools menu in Visual Basic Editor and select Microsoft DAO 3.5 Object Library.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional query words: 8.00 97 GP Fault GPF
Keywords : kbprg ODBCGen |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |