ASP 中 SQL语句where中的条件如何使用循环

如下语句:sql = "Select * From name where A,B,C like AA,BB,CC"
Set rs = conn.Execute(sql) 其中 A,B,C 和 AA,BB,CC 都是循环得出的,根据提交过来的数据多少而定 可能是 A,B,C 也可能是 A,B,C,D,E 是一个不定数 请问如何在 where 中使用循环语句呢?循环提交过来的数据!或者通过其他形式,可以实现就可以!

第1个回答  2013-11-26
str1 = Request("str1") '例如"A,B,C"str2 = Request("str2") '例如"AA,BB,CC"sql = "Select * From name where " & str1 & " like " & str2Set rs = conn.Execute(sql)
第2个回答  2013-11-26
如果是在数据库里的话,用游标很好处理的
相似回答
大家正在搜