zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

ASP中如何将数据库内容导入到数组?并进行字符串对比

数据库ASP数组 如何 字符串 进行 内容 对比
2023-09-14 08:59:25 时间

dim Arr
sql1="select id from [aaa] where reader not like '%"&userid&"%'"
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,0,1
Arr=""
do while not rs1.eof
If Arr="" Then
Arr=Rs1("id")
Else
Arr=Arr&","&Rs1("id")
End If
rs1.movenext
loop
rs1.close
Set rs1 = Nothing
'response.write Arr

 

===========================

 

bb = "小黄,小李,小赵"  '可以当成数组
AA="小赵"
if instr(bb,AA) > 0 then
  response.Write "aa"
end if