Excel OLEDB - Invalid SQL Statement

jonnymop5

Member
I'm trying to pull a simple ---
Select * From [Excel Sheet]

Could not execute code stage because exception thrown by code stage: Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.

I'm trying to use various versions of the following statement. With [Excel Sheet] data item being the excel sheet MCDR with a $ after. So [MCDR$]

"select"&NewLine()&
"*"&NewLine()&
"from”&NewLine()&
“&"’"&[Excel Sheet]&"'"&"”"
 

Rich

Member
Hi,
Not sure if it's perhaps something to do with the NewLine()'s in your calc?

Or is it expecting select in all capital letters.

SELECT * FROM [MCDR$] should be fine.

Have you set the connection string correctly to the spreadsheet and opened the connection? (https://www.connectionstrings.com/excel/)
rich
 
Top