This is not going to execute one giant sql statement; it is going to execute MANY SELECT statements.
You need something like
Dim sSqlMaster, sSqlLike
sSqlMaster = ""SELECT DISTINCT TOP 65535 T1.A,T1.B " & _
"FROM Table1 " & _
"WHERE T1.A "
For i = 0 to i =count step 1
sSqlLike = sSqlLike & "LIKE '" & part[i]& "%' AND T1.A "
Next
sSqlMaster = sSqlMaster & Left(sSqlLike, (Len(sSqlLike) - 10))
Your string will also have a trailing AND T1.A which you will need to remove which is what the LEFT() function is doing. (I am assuming that you are using classic ASP based upon your other posts in the forum)
hth
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========