Q+E: Excel Err Msg: SQL Statement Is Not Valid or DDE Error

Last reviewed: September 12, 1996
Article ID: Q95828
The information in this article applies to:
  • Q+E for Microsoft Excel for Windows, version 3.0, 3.0a
  • Q+E for Microsoft Excel for OS/2, version 3.0
  • Microsoft Excel for Windows, versions 3.0 and 4.0
  • Microsoft Excel for OS/2, versions 3.0

SUMMARY

When you try to execute an SQL query statement to extract data from an external database using the QE.XLA add-in macro in Microsoft Excel, the error message "SQL Statement Is Not Valid or DDE Error" may be generated if the external data type differs from the default data type set in Q+E.

MORE INFORMATION

With the QE.XLA add-in macro loaded, SQL query statements can be used to extract data from external databases into a Microsoft Excel worksheet. Activating the Query Editor by choosing the SQL Query command on the Data menu allows SQL queries to be entered, executed, and saved as query files (.QEF) in Microsoft Excel.

The error "SQL Statement Is Not Valid or DDE Error" may occur if the SQL query or saved query file (.QEF) attempts to extract data from an external database that is of a different type than the default data type set in Q+E.

Workarounds

  • Modify the SQL query to include the external database type followed by a pipe character (|). For example:

          SELECT FIRST_NAME, LAST_NAME FROM dBASEFile|C:\EXCEL\QE\ADDR.DBF
    
  • Change the default data type in Q+E to match the database type in your SQL query statement. To do this, modify the [Q+E] section of the QE.INI file to include the initialization parameter CONNECT=<File Type>. For example:

          CONNECT=dBASEFile
    

    You can also change the default data type in Q+E by rerunning the Q+E portion of the Microsoft Excel Setup program.

    Note: Versions of Q+E for Microsoft Excel for Windows prior to 3.0a, dated 6/12/91, use the [Q+E] section of the WIN.INI file for initialization parameters, not the QE.INI file. The QE.INI file for Q+E for Microsoft Excel for OS/2 is saved as a binary file and cannot be modified.

REFERENCES

"Q+E for Microsoft Excel User's Guide," version 3.0a, included with Microsoft Excel version 3.0, pages 35-36, 66-67

"Q+E for Microsoft Excel User's Guide," version 3.0a, included with Microsoft Excel version 4.0, pages 35-36, 66-67


KBCategory: kberrmsg
KBSubcategory:

Additional reference words: 3.0 3.00 4.0 QE 4 4.0a 4.00a



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: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.