The information in this article applies to:
SYMPTOMS
In the versions of Microsoft Excel listed above, when you use the return
value of the SQLRetrieve function and the query does not return any data,
the return value is an error rather than the expected value 0.
SQLRetrieve returns the number of rows in the result set. If SQLRetrieve is unable to retrieve the results on the specified data source or if there are no results pending, it returns Error 2042. If no data is found, it returns 0. WORKAROUND
Although the SQLRetrieve command returns an error because no records match
the query, the SQLExecquery command successfully returns the number of
columns.
Sample MacroMicrosoft 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.asp
STATUSMicrosoft has confirmed this to be a problem in the products listed at the beginning of this article. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition. Additional query words: VBA_XL.HLP
Keywords : |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |