I came across this problem as well. The solution for me turned out to be the name of the Tab in the excel document for one of the files in the loop. I removed the parameter in the "from" statement that references the tab, so it would default to the first tab.
In your case you are not specifying the tab, but I wager a parameters in the "from" statement doesn't apply to one of the files picked up in the loop.
For troubleshooting it is recommended to run the failing query in a third party SQL query tool, with the following considerations.
- Use the same ODBC or OLEDB connection
- Use the same underlying database driver
- Access the same database server
- Use the same user credentials, username and password. NOTE: Use the QlikView service user if issue is related to QlikView Server
The third party tool should return an unexpected result. In this context pay extra attention to that the field names are exactly as expected and in readable language without garbage characters.
Common resolution is to correct SQL query so that a valid and expected result is returned by database.
The error message comes from QlikView engine and is related to the database result not having valid fields. Typically this is due to the usage of LOAD * , which means that QlikView will parse the resuls in order to find the returned field names. For some reason the data base has not returned a valid result, most likely due to database driver issues or an invalid SQL query. If this does not resolve your issue, please log a case with Qlik Support. However if it does, please mark this as the correct answer.