Microsoft KB Archive/95828

{| = Q+E: Excel Err Msg: SQL Statement Is Not Valid or DDE Error =
 * width="100%"|

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 &quot;SQL Statement Is Not Valid or DDE Error&quot; 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 &quot;SQL Statement Is Not Valid or DDE Error&quot; 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=. 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. 