DB Functions Require Full Pathname For ExtractLast reviewed: November 4, 1994Article ID: Q82983 |
Summary:
Using the DB functions with Q+E require the complete table name when extracting information from an SQL Server database. Not providing the complete name will result in the failure of the extract. More Information: While the DB.SET.DATABASE() command may be set the database to a valid table, the query will not be able to be performed correctly, the query needs to use this complete table name to perform the query.
Steps to Reproduce ProblemType the following macro into an Excel macro sheet.
A1 =DB.LOGON("sqlserver") A2 =DB.SET.DATABASE(FALSE,"sqlserver","sales") A3 =DB.PASTE.FIELDNAMES("Sales") A4 =DB.EXTRACT(FALSE,1,,FALSE) A5 =RETURN()Run this macro from a worksheet. It will fail to retrieve any information back to the worksheet. Modify lines A2 and A3 as follows:
A2 =DB.SET.DATABASE(FALSE,"sqlserver","pubs.dbo.sales") A3 =DB.PASTE.FIELDNAMES("pubs.dbo.Sales")Again, run the macro from a worksheet. This will extract the table from the SQL Server and retrieve the information back to the worksheet. Reference(s): "Q+E For Microsoft Excel User's Guide," page 70
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |