I am trying to a sql statement in a for loop. The for condition runs for the UBOUND of array which stores the condition for WHERE clause in the following format:

Please Login or Register  to view this content.
The code fails at rs.open sql and gives a Type Mismatch error. The workflow is : run for loop for all the items in the array, plug in values in sql and dump the result in excel.

Excel: 2003
Database: SQL Server
OS: Windows XP SP3
Connection: ADODB


Any help/suggestions will be greatly appreciated.

Thanks,