try this,set rs_t=server.CreateObject("ADODB.recordset") TXT0="房" TXT1="1"; sql="SELECT [LOCATION] FROM [PWNT].[dbo].[READER] where charindex('" & TXT0 & "',[LOCATION],1)>0 "rs_t.open sql,conn,1,3 do while not rs_t.eof response.Write(rs_t("LOCATION")) rs_t.movenext loop rs_t.close set rs_t=nothing
try this,set rs_t=server.CreateObject("ADODB.recordset") TXT0="房" TXT1="1"; sql="SELECT [LOCATION] FROM [PWNT].[dbo].[READER] where charindex(N'" & TXT0 & "',[LOCATION],1)>0 "
rs_t.open sql,conn,1,3 do while not rs_t.eof response.Write(rs_t("LOCATION")) rs_t.movenext loop rs_t.close set rs_t=nothing
TXT0="房"
TXT1="1";
sql="SELECT [LOCATION] FROM [PWNT].[dbo].[READER] where charindex('" & TXT0 & "',[LOCATION],1)>0 "rs_t.open sql,conn,1,3
do while not rs_t.eof
response.Write(rs_t("LOCATION"))
rs_t.movenext
loop
rs_t.close
set rs_t=nothing
TXT0="房"
TXT1="1";
sql="SELECT [LOCATION] FROM [PWNT].[dbo].[READER] where charindex(N'" & TXT0 & "',[LOCATION],1)>0 "
rs_t.open sql,conn,1,3
do while not rs_t.eof
response.Write(rs_t("LOCATION"))
rs_t.movenext
loop
rs_t.close
set rs_t=nothing
查询时须在查找字符串前加"N",指定为unicode数据.