Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.

How do I resolve the error "(HY000) [Microsoft][ODBC Excel Driver] Syntax error in query. Incomplete query clause"?

How do I resolve the error "(HY000) [Microsoft][ODBC Excel Driver] Syntax error in query. Incomplete query clause"?

This error will usually occur when you are incorrectly using DB Tester to perform an SQL statement against a Microsoft Excel Sheet. Below is an example of a standard DB_Execute statement which would be run against an Excel spreadsheet:

hSQL = DB_ExecuteSQL (hDB, "SELECT * FROM `Sheet1$` `Sheet1$`")

Make sure that when you reference the Excel sheet name, that you are enclosing the name in `apostrophes`, and not in "single quotes" because this will result in the error above.

`Sheet1$` will work"Sheet1$" will generate error

Old KB# 21997

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:26
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.