<%
dim selmethod
dim selname
dim sqlstr
selmethod=trim(request.Form("selmethod"))
selname=trim(request.Form("selname"))
Select Case selmethod
Case "公司名称"
sqlstr="select * from basicinfo where company='"&selname&"' and accemp='"&session("empname")&"'"
set rs=conn.execute(sqlstr)
if not(rs.bof and rs.eof) then
for i=1 to rs.Fields.count-1
response.Write "<td>"&response.Write("rs(i).name")&"</td>"
next
else
response.Write "<script language='javascript'>alert('该公司不存在或你无权查询该公司信息!');</script>"
end if
Case "联系人"
sqlstr="select * from basicinfo where touchperson='"&selname&"' and accemp='"&session("empname")&"'"
set rs=conn.execute(sqlstr)
if not(rs.bof and rs.eof) then
for i=1 to rs.Fields.count-1
response.Write "<td>"&response.Write("rs(i).name")&"</td>"
next
else
response.Write "<script language='javascript'>alert('该联系人不存在或你无权查询所属公司信息!');</script>"
end if
End Select
rs.close
set rs=nothing
conn.close
set conn=nothing
%>