Microsoft KB Archive/277587

= You may receive an error message when you open a DQY file in Excel =

Article ID: 277587

Article Last Modified on 2/2/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition

-



This article was previously published under Q277587





SYMPTOMS
When you open a Microsoft Query file (.dqy) in Microsoft Excel, 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.

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.

This error message is followed by the following error message:

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 lines of the file.

Note You may find tab and carriage-return characters elsewhere in in the file. Those characters must remain intact.
 * 1) On the File menu, click Save, and then exit Notepad.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



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.

Additional query words: XL2002 XL2003 XL2007

Keywords: kbprb kbtshoot kbexpertisebeginner kbbug kberrmsg kbpending KB277587

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.