View Single Post
 
Old 10-26-2018, 03:31 AM
travb81 travb81 is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2017
Posts: 11
travb81 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
SQLStatement is suitable for query strings up to 255 characters. Where the query string is longer than 255 characters, you'd use SQLStatement1 for the remainder; there is no specified character limit for SQLStatement1.
Hi Paul,
Are you sure SQLStatement1 accepts a longer string?

Code:
    
strSQL1 = Left(strSQL, 255)
strSQL2 = Right(strSQL, Len(strSQL) - 255)
My statement is 514 characters long, and the .OpenDataSource statement is throwing up runtime error 9105, 'string is longer than 255 characters'.
If I remove a few spaces or one of the WHERE criteria from the statement, it executes ok...

Reply With Quote