XL2002: "SELECT Statement" Error Message When You Open DQY Files (277587)



The information in this article applies to:

  • Microsoft Excel 2002

This article was previously published under Q277587

SYMPTOMS

When you open a Microsoft Query file (.dqy), you may receive one of the following error messages:
[Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

-or-

File could not be opened. It is either damaged or the file format is not valid. Try opening it in the application that created it and saving to a new file.

followed by:

Unable to open or read this connection file. Either the file has been damaged or the file format is not valid.

CAUSE

This behavior can occur if the SELECT statement in the .dqy file contains the tab or carriage-return characters.

WORKAROUND

To work around this issue, remove all tab and carriage-return characters from the SELECT statement in the Microsoft Query file. To do this, follow these steps:
  1. Make a backup copy of your .dqy file.
  2. Open the .dqy file in Notepad.
  3. Delete all tab and carriage-return characters from the SELECT statement portion of the file.

    NOTE: You may find tab and carriage-return characters elsewhere in in the file. Those characters must remain intact.
  4. On the File menu, click Save, and then quit Notepad.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

When you create a .dqy file by using Microsoft Query, the SELECT statement does not contain any additional non-alphanumeric characters other than spaces, periods, semicolons, apostrophes, or quotation marks.

REFERENCES

For more information about importing data, click Microsoft Excel Help on the Help menu, type microsoft query in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Modification Type:MajorLast Reviewed:9/29/2001
Keywords:kbbug kberrmsg KB277587