The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you use the SQLRetrieve function or the SQLRequest function to return data from an external database, a field in the database that does not contain data may be returned with a value. CAUSE
This behavior occurs when you use the SQLRetrieve function or the
SQLRequest function available in the ODBC Add-in file, XLODBC.XLA, to
return data from an external database. When the database contains a column
of number data type values, and one of the fields in this column is empty
(null), the value in the previous field in the database is returned for
this field when the data is returned to a worksheet in Microsoft Excel.
the following data is returned to the worksheet:
This problem has been reported using the following data sources:
Note that this problem does not occur with columns of text data type.
WORKAROUNDTo work around this behavior, use the functions in the Microsoft Query add-in, the XLQUERY.XLA file to return data from an external database to a worksheet in Microsoft Excel. The following example returns a query from the table "test" in the DB1.MDB database using a Microsoft Access 2.0 data source. The data is returned to cell A1 on Sheet1 in BOOK1.XLS:
Microsoft provides examples of Visual Basic for Applications procedures 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. The Visual Basic procedures in this article are
provided 'as is' and Microsoft does not guarantee that they can be used in
all situations. While Microsoft support professionals can help explain the
functionality of a particular macro, they will not modify these examples to
provide added functionality, nor will they help you construct macros to
meet your specific needs. If you have limited programming experience, you
may want to consult one of the Microsoft Solution Providers. Solution
Providers offer a wide range of fee-based services, including creating
custom macros. For more information about Microsoft Solution Providers,
call Microsoft Customer Information Service at (800) 426-9400.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c. REFERENCESFor more information about the SQLRetrieve Function, choose the Search button in the Visual Basic Reference and type: SQLRetrieve FunctionFor more information about the QueryGetData Function, choose the Search button in the Visual Basic Reference and type: QueryGetData Function Additional query words: 5.00a oracle
Keywords : xlwin |
Last Reviewed: November 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |