如何把从数据库查询到的结果在当前页用表格显示出来? 20
我写的这段代码,点查询的时候。没有任何反映!<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%><%setconn=server.Create...
我写的这段代码,点查询的时候。没有任何反映!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
set conn=server.CreateObject("adodb.connection")
conn.connectionstring="Provider=MicroSoft.JET.OLEDB.4.0;Data source="&server.MapPath("db1.mdb")
conn.open
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK rel=stylesheet type=text/css href="index_files/reset.css">
<title>3Q宝贝授权经销商查询</title>
</head>
<BODY>
<DIV class=main>
<DIV id=top>
<DIV id=header></DIV>
<DIV class=p_txt>请输入经销商授权编号查询</DIV>
<DIV id=seacher>
<DIV class=sb_l></DIV>
<DIV class=sb_r></DIV>
<DIV class=seachForm>
<%
if request.form("submit")<>"" then
whaturl=request.form("number")
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from url where number like '%"&whaturl&"%' "
rs.Open sql,conn,1,1
%>
<%
if rs.EOF and rs.BOF then
response.write ("未能查到")
else
Do Until rs.EOF
response.write("<hr>授权编号是:"&rs("number"))
response.Write("<img src="&rs("url")&" />")
rs.MoveNext
Loop
end if
%>
<%
rs.close
Set rs = Nothing
conn.close
set conn=Nothing
else
%>
<FORM id=form method=post
name=form
action="show.asp"
target=_self>
<DIV class=licenseInput><INPUT name="number" TYPE="text" class=keywords id=number size=8 maxlength="8"></DIV>
<DIV class=licenseButt><INPUT class=go value="" type=submit name=submit></DIV>
</FORM>
<%end if%>
</DIV>
</DIV>
<DIV class=bk20></DIV>
<DIV
class=p_txt><STRONG>搜索说明:</STRONG><BR>输入编号即可查询到该授权经销商的信息!如果不存在该经销售商,搜索结果为<STRONG
class=red>空</STRONG>或者是提示<STRONG
class=red>搜索不到</STRONG>!<BR><BR>为保障阁下的权益,请认准授权经销商购买产品!<BR><BR></DIV></DIV></DIV>
<DIV id=footer>
<CENTER>Copyright (C) 2007-2014 深圳市宇达为电子有限公司 All Rights
Reserved</CENTER><p><a href="www.aaeworld.net.cn">返回首页</a></p></DIV>
</BODY></HTML> 展开
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
set conn=server.CreateObject("adodb.connection")
conn.connectionstring="Provider=MicroSoft.JET.OLEDB.4.0;Data source="&server.MapPath("db1.mdb")
conn.open
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK rel=stylesheet type=text/css href="index_files/reset.css">
<title>3Q宝贝授权经销商查询</title>
</head>
<BODY>
<DIV class=main>
<DIV id=top>
<DIV id=header></DIV>
<DIV class=p_txt>请输入经销商授权编号查询</DIV>
<DIV id=seacher>
<DIV class=sb_l></DIV>
<DIV class=sb_r></DIV>
<DIV class=seachForm>
<%
if request.form("submit")<>"" then
whaturl=request.form("number")
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from url where number like '%"&whaturl&"%' "
rs.Open sql,conn,1,1
%>
<%
if rs.EOF and rs.BOF then
response.write ("未能查到")
else
Do Until rs.EOF
response.write("<hr>授权编号是:"&rs("number"))
response.Write("<img src="&rs("url")&" />")
rs.MoveNext
Loop
end if
%>
<%
rs.close
Set rs = Nothing
conn.close
set conn=Nothing
else
%>
<FORM id=form method=post
name=form
action="show.asp"
target=_self>
<DIV class=licenseInput><INPUT name="number" TYPE="text" class=keywords id=number size=8 maxlength="8"></DIV>
<DIV class=licenseButt><INPUT class=go value="" type=submit name=submit></DIV>
</FORM>
<%end if%>
</DIV>
</DIV>
<DIV class=bk20></DIV>
<DIV
class=p_txt><STRONG>搜索说明:</STRONG><BR>输入编号即可查询到该授权经销商的信息!如果不存在该经销售商,搜索结果为<STRONG
class=red>空</STRONG>或者是提示<STRONG
class=red>搜索不到</STRONG>!<BR><BR>为保障阁下的权益,请认准授权经销商购买产品!<BR><BR></DIV></DIV></DIV>
<DIV id=footer>
<CENTER>Copyright (C) 2007-2014 深圳市宇达为电子有限公司 All Rights
Reserved</CENTER><p><a href="www.aaeworld.net.cn">返回首页</a></p></DIV>
</BODY></HTML> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询