日期:2014-05-17  浏览次数:20932 次

请教ASP函数和SQL语句的两个问题
<%
types=request.QueryString("type")
Function types_type(types_name)
  if types_name<>"" then
  type_sql = "select * from brand where type='"&types_name&"'"
  set type_rs=conn.execute(type_sql)
brand_sql = "select * from brand where type_id="&type_rs("id")
  set brand_rs=conn.execute(brand_sql)
sql="select * from BI where type="&type_rs("id")'&" and brand="&brand_rs("id")
else
sql="select * from BI order by type,brand"
end if
end Function
if types="Desktop" then
  type_name="台式计算机"
sql=types_type(type_name)
response.Write(types_type(type_name))
set rs=conn.execute(sql)
elseif types="Notebook" then
  type_name="笔记本计算机"
sql=types_type(type_name)
response.Write(types_type(type_name))
set rs=conn.execute(sql)
elseif types="Server" then
  type_name="服务器"
sql=types_type(type_name)
response.Write(types_type(type_name))
set rs=conn.execute(sql)
elseif types="Office" then
  type_name="打印机' or type='复印机' or type='传真机' or type='扫描仪' or type='多功能一体机"
sql=types_type(type_name)
response.Write(types_type(type_name))
set rs=conn.execute(sql)
elseif types="Network" then
  type_name="网络设备"
sql=types_type(type_name)
response.Write(types_type(type_name))
set rs=conn.execute(sql)
else
sql=types_type(type_name)
response.Write(types_type(type_name))
set rs=conn.execute(sql)
end if

%>

<link href="images/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
  <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
  <td valign="top" background="images/content-bg.gif"><table width="98%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
  <tr>
  <td height="31"><div class="titlebt">基本设备</div></td>
  </tr>
  </table></td>
  <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
  <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
  <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
  <tr>
  <td height="13" valign="top">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <td class="left_txt">当前位置:基本设备</td>
  <