28,391
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<form action="index.asp" name="form">
<p>
<input type="text" id="name" name="name" />
</p>
<p> </p>
<p>
<input type="submit" name="submit" id="submit" value="提交">
</p>
<p> </p>
</form>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<meta http-equiv="refresh" content="10" />
<title>无标题文档</title>
</head>
<!--#include file="conn.asp"-->
<%
Dim conn
Dim StrConn
Dim rs
Dim Sql
Set conn=Server.CreateObject("ADODB.Connection")
StrConn="Driver={Microsoft Excel Driver (*.xls)};DBQ="& Server.MapPath("database\list.xls")
conn.Open StrConn
Set rs = Server.CreateObject("ADODB.Recordset")
Sql="select * from [Sheet1$] where name like '"&name&"'"
rs.Open Sql,conn,2,2
%>
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<%
for i=0 to rs.Fields.Count-1
%>
<td width="1" bgcolor="#CCCCCC"></td>
<td height="28" bgcolor="#0099FF"><div align="center"><%=rs(i).Name%></div></td>
<%
next
%>
<td width="1" bgcolor="#CCCCCC"></td>
</tr>
<%
do while Not rs.EOF
%>
<tr>
<%
for i=0 to rs.Fields.Count-1
%>
<td width="1" bgcolor="#CCCCCC"></td>
<td height="28" valign="bottom"><%=rs(i)%></td>
<%
next
%>
<td width="1" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<%
for i=0 to rs.Fields.Count-1
%>
<td height="1" bgcolor="#CCCCCC"></td>
<td height="1" bgcolor="#CCCCCC"></td>
<%
next
%>
<td width="1" bgcolor="#CCCCCC"></td>
</tr>
<%
rs.MoveNext
Loop
rs.close
set rs=nothing
Conn.close
set StrConn=nothing
%>
</table>
</center>
</body>
</html>