关于ASP操作EXECL的例子的疑问(定位到指定的一行一列)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>运用普通的数据库链接读取EXCEL文件内容</title>
</head>
<body bgcolor="#FFFFFF" >
<h2 align="center">运用普通的数据库链接读取EXCEL文件内容</h2>
<CENTER>
<TABLE border="0" style="font-size: 10pt" style="border: 2 groove #000000">
<%
'创建数据库链接,注意这下面的[sheet1$]为实际表中的名字,如果原表名不是起这样的名字的话将引起出错
set cn=server.createobject("adodb.connection")
stropen="driver={microsoft excel driver (*.xls)}; dbq="& server.mappath("test.xls")
cn.open stropen
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From [sheet1$]", cn, 2, 2
Do While Not rs.EOF
Response.Write "<TR bgColor=#e6e6e6>"
Response.Write"<TD width=100>"&RecNo&"</TD>"
for i=0 to rs.fields.count-1
if rs.Fields(i).Value = "" then
strValue = "空"
else
strValue = rs.Fields(i).Value
end if
strResponse = "<TD width=100>" & strValue & "</TD>"
Response.write strResponse
Next
Response.Write "</TR>"
rs.MoveNext
RecNo=RecNo+1
Loop
rs.close
%>
</TABLE>
</CENTER>
</body>
</html>
这是我在CSDN得到的例子.我现在想定位到指定的一行一列上,读出值,怎么读法?
比如要读20行30列,代码如何写?请教!!!