DB Functions Require Full Pathname For Extract

Last reviewed: November 4, 1994
Article 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 Problem

Type 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
KBSubcategory:

Additional reference words: 3.0 3.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 4, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.