主题:asp中变量问题
<body>
<table>
<tr>
<%
dim c
c = 10 ' 每列显示记录数
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("db\byte8899199.mdb")
Set rs = Server.CreateObject("adodb.recordset")
sql = "select distinct encapsulation from Products"
rs.open sql, conn, 1, 1
%>
<TABLE border=1 bordercolor="#ffdeab" width="60%" align=center cellspacing=0>
<tr>
<td colspan="50" align="center">encapsulation</td>
</tr>
<tr>
<%
Do While Not rs.EOF
Response.Write "<td>"
For i = 1 To c
If Not rs.EOF Then
%>
<a href=""b.asp"?act="<%=rs("encapsulation")%>""><%=rs("encapsulation")%></a><br />
<% rs.MoveNext
End If
Next
Response.Write "</td>"
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</tr>
</table>
</body>
这是a.asp 查询出来的encapsulation字段以超连接显示出来.可以正常显示.我想要:当点击"encapsulation"内容,(如encapsulation是A-401,)当点击这个"A-401"时能把"A-401"传递到B.asp,同时打开b.asp ,同时在b.asp中提取到"A-401",再按files="A-401",进行查询,且以超连接显示出来,下面是我b.asp.那里有错啊,帮我改改,多谢,多谢......
<body>
<table>
<tr>
<%
dim c
c = 10 ' 每列显示记录数
strID=request.QueryString ("act")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("db\byte8899199.mdb")
Set rs = Server.CreateObject("adodb.recordset")
sql = "select distinct files from Products where encapsulation=strid"
rs.open sql, conn, 1, 1
%>
<TABLE border=1 bordercolor="#ffdeab" width="60%" align=center cellspacing=0>
<tr>
<td colspan="50" align="center">files</td>
</tr>
<tr>
<%
Do While Not rs.EOF
Response.Write "<td>"
For i = 1 To c
If Not rs.EOF Then
%>
<a href="<%=rs("files")%>"><%=rs("files")%></a><br />
<% rs.MoveNext
End If
Next
Response.Write "</td>"
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</tr>
</table>
</body>
谢谢
<table>
<tr>
<%
dim c
c = 10 ' 每列显示记录数
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("db\byte8899199.mdb")
Set rs = Server.CreateObject("adodb.recordset")
sql = "select distinct encapsulation from Products"
rs.open sql, conn, 1, 1
%>
<TABLE border=1 bordercolor="#ffdeab" width="60%" align=center cellspacing=0>
<tr>
<td colspan="50" align="center">encapsulation</td>
</tr>
<tr>
<%
Do While Not rs.EOF
Response.Write "<td>"
For i = 1 To c
If Not rs.EOF Then
%>
<a href=""b.asp"?act="<%=rs("encapsulation")%>""><%=rs("encapsulation")%></a><br />
<% rs.MoveNext
End If
Next
Response.Write "</td>"
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</tr>
</table>
</body>
这是a.asp 查询出来的encapsulation字段以超连接显示出来.可以正常显示.我想要:当点击"encapsulation"内容,(如encapsulation是A-401,)当点击这个"A-401"时能把"A-401"传递到B.asp,同时打开b.asp ,同时在b.asp中提取到"A-401",再按files="A-401",进行查询,且以超连接显示出来,下面是我b.asp.那里有错啊,帮我改改,多谢,多谢......
<body>
<table>
<tr>
<%
dim c
c = 10 ' 每列显示记录数
strID=request.QueryString ("act")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("db\byte8899199.mdb")
Set rs = Server.CreateObject("adodb.recordset")
sql = "select distinct files from Products where encapsulation=strid"
rs.open sql, conn, 1, 1
%>
<TABLE border=1 bordercolor="#ffdeab" width="60%" align=center cellspacing=0>
<tr>
<td colspan="50" align="center">files</td>
</tr>
<tr>
<%
Do While Not rs.EOF
Response.Write "<td>"
For i = 1 To c
If Not rs.EOF Then
%>
<a href="<%=rs("files")%>"><%=rs("files")%></a><br />
<% rs.MoveNext
End If
Next
Response.Write "</td>"
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</tr>
</table>
</body>
谢谢