Try to pass the entire SQL Query in single line. I have SQLQueries, those were really long and I am sure they are more than 1026 character limit. I did concatenate the entire query in single line string, it did work properly.
SQLQuery = "Select * from ................................................................................"
SQLQuery = "Select * from ................................................................................"