回复 5楼 dwsc103
好的,请问以下代码要按照你的修改如何进行,谢谢
<%
Dim Conn, Driver, DBPath, Rs, name
Set Conn=Server.CreateObject("ADODB.Connection")
'确定数据源路径
Driver="Driver={Microsoft Excel Driver (*.xls)};"
DBPath="DBQ=" & Server.MapPath("test.xls")
'调用Open方法打开数据库,生成记录集
Conn.Open Driver & DBPath
Sql="Select * From [Sheet1$] where 个体>0"
Set Rs=Conn.Execute(Sql)
'读入数据,确定动态数组
Do While Not Rs.EOF
k=k+1: Rs.MoveNext: Loop
Rs.Close: Set Rs=nothing
Conn.Close: Set Conn=Nothing
ReDim n(k,4), m(k,4)
'数据读入数组并计算
Set Conn=Server.CreateObject("ADODB.Connection")
Driver="Driver={Microsoft Excel Driver (*.xls)};"
DBPath="DBQ=" & Server.MapPath("test.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("母本"):n(i,4)=Rs("评分")
Rs.MoveNext:Loop
Rs.Close:Set Rs=Nothing
Conn.Close:Set Conn=Nothing
%>
另,Rs.Open SqlConn,
1,3
这个1,3是什么意思呀
[
本帖最后由 dwsc103 于 2010-9-28 18:29 编辑 ]