程序代码:
<%
Dim Conn,Driver,DBPath,Rs,m(500,13),n(500,4),o(500,4)
Set Conn=Server.CreateObject("ADODB.Connection")
Driver="Driver={Microsoft Excel Driver (*.xls)};"
DBPath="DBQ=" & Server.MapPath( "资料.xls" )
Conn.Open Driver & DBPath
Sql="Select * From [Sheet1$] where 个体>0"
Set Rs=Conn.Execute(Sql)
Do While Not Rs.EOF
i=i+1
n(i,1)=Rs("个体")
n(i,2)=Rs("父本")
n(i,3)=Rs("母本")
Rs.MoveNext
Loop
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn=Nothing
%>
<form method=post>
<table><tr><td>个体编号:<td><input type=text name ="v" size =12>
<input type=submit value ="确定">
</td><tr></table></form>
<table style='border-collapse: collapse;table-layout:fixed;width:200pt'>
<%
name=Request.Form("v")
IF Name<>"" Then
o(1,1)=name
FOR i=1 to 500
IF n(i,1)=name Then
o(2,1)=n(i,2)
o(3,1)=n(i,3)
end IF
Next
End IF
%>
<tr><td colspan=2></td>
<td class=5>耳号 <%Response.Write o(2,1)%></td></tr>
<td class=5>耳号 <%Response.Write o(1,1)%></td></tr>
<tr><td colspan=2></td>
<td class=7>耳号 <%Response.Write o(3,1)%></td></tr>
</table>