Microsoft KB Archive/82983

{| = DB Functions Require Full Pathname For Extract =
 * width="100%"|

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(&quot;sqlserver&quot;) A2 =DB.SET.DATABASE(FALSE,&quot;sqlserver&quot;,&quot;sales&quot;) A3 =DB.PASTE.FIELDNAMES(&quot;Sales&quot;) 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,&quot;sqlserver&quot;,&quot;pubs.dbo.sales&quot;) A3 =DB.PASTE.FIELDNAMES(&quot;pubs.dbo.Sales&quot;) 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):

&quot;Q+E For Microsoft Excel User's Guide,&quot; page 70
 * }