<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=Conn.asp-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Language" content="zh-cn">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>123</title>
<div class="s_zm">
名词解释:
<ul>

<%
  set rs=createobject("adodb.recordset")
Sql="Select * From 民谣歌曲 where zm="&request.querystring("zm")
  rs.open sql,conn,1,1
set rs=conn.execute(sql)
  do while not rs.eof  
%>
<li>
<%=rs("英文")%>&nbsp;&nbsp;<%=rs("中文")%>
</li>
<%
rs.movenext
loop
%>
</ul>
</div>




</body>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</html>

我想通过request.querystring 传递一个值xx.asp?zm=1 列出数据库里zm表=1的数据。但不行求大大门指点。


1个回答

set rs=createobject("adodb.recordset")
Sql="Select * From 民谣歌曲 where zm="&request.querystring("zm")
rs.open sql,conn,1,1
set rs=conn.execute(sql)

要么是:

set rs=createobject("adodb.recordset")
Sql="Select * From 民谣歌曲 where zm="&request.querystring("zm")
rs.open sql,conn,1,1

要么是:

Sql="Select * From 民谣歌曲 where zm="&request.querystring("zm")
set rs=conn.execute(sql)

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
也改成:
<%
rs.close
set rs=nothing
%>