ASP读取Excel(.xsl)文件
来源:互联网 发布:人工智能行业图谱 编辑:程序博客网 时间:2024/05/22 17:09
<html>
<head>
<title>操纵Excel</title>
</head>
<body>
<h2 align="center">显示Excel文件示例</h2>
<table border="1" width="90%" align="center">
<tr align="center" bgcolor="#E6E6E6">
<td>学号</td><td>姓名</td><td>数学</td><td>语文</td><td>英语</td><td>总分</td>
</tr>
<%...
'建立Connection对象
Dim db,rs,strSql
Set db = Server.CreateObject("ADODB.Connection")
db.Open "Driver={Microsoft Excel Driver (*.xls)};Dbq=" & Server.MapPath("Mark.xls")
'打开记录集,表名一定要以"[表名$]"的格式
strSql="Select * From [Sheet1$]"
Set rs=db.Execute(strSql)
'循环读取所有行
Do While Not rs.EOF
Response.Write "<tr align='center'>"
Response.Write "<td>" & rs("学号") & "</td>"
Response.Write "<td>" & rs("姓名") & "</td>"
Response.Write "<td>" & rs("数学") & "</td>"
Response.Write "<td>" & rs("语文") & "</td>"
Response.Write "<td>" & rs("英语") & "</td>"
Response.Write "<td>" & rs("总分") & "</td>"
Response.Write "</tr>"
rs.MoveNext
Loop
'关闭对象
rs.Close
Set rs=nothing
db.Close
Set db=Nothing
%>
</table>
</body>
</html>
<head>
<title>操纵Excel</title>
</head>
<body>
<h2 align="center">显示Excel文件示例</h2>
<table border="1" width="90%" align="center">
<tr align="center" bgcolor="#E6E6E6">
<td>学号</td><td>姓名</td><td>数学</td><td>语文</td><td>英语</td><td>总分</td>
</tr>
<%...
'建立Connection对象
Dim db,rs,strSql
Set db = Server.CreateObject("ADODB.Connection")
db.Open "Driver={Microsoft Excel Driver (*.xls)};Dbq=" & Server.MapPath("Mark.xls")
'打开记录集,表名一定要以"[表名$]"的格式
strSql="Select * From [Sheet1$]"
Set rs=db.Execute(strSql)
'循环读取所有行
Do While Not rs.EOF
Response.Write "<tr align='center'>"
Response.Write "<td>" & rs("学号") & "</td>"
Response.Write "<td>" & rs("姓名") & "</td>"
Response.Write "<td>" & rs("数学") & "</td>"
Response.Write "<td>" & rs("语文") & "</td>"
Response.Write "<td>" & rs("英语") & "</td>"
Response.Write "<td>" & rs("总分") & "</td>"
Response.Write "</tr>"
rs.MoveNext
Loop
'关闭对象
rs.Close
Set rs=nothing
db.Close
Set db=Nothing
%>
</table>
</body>
</html>
- ASP读取Excel(.xsl)文件
- asp读取Excel文件
- ASP.NET读取Excel文件
- asp.net 读取excel文件
- ASP.NET中读取Excel文件数据
- 如何用asp读取Excel文件
- 如何用asp读取Excel文件
- 如何用asp读取Excel文件
- 如何用asp读取Excel文件
- asp.net C# NPOI 读取 Excel 文件
- ASP.NET如何高效读取EXCEL文件
- ASP读取EXCEL数据
- ASP读取EXCEL
- ASP.NET读取EXCEL
- ASP.NET读取EXCEL
- ASP读取EXCEL数据
- Asp.Net 读取Excel
- asp.net 读取excel
- Win32程序设计基础
- 全面了解ODBC技术
- 深入Windows通信编程
- 找回 Linux 密码
- 博客技巧--添加搜索引擎代码
- ASP读取Excel(.xsl)文件
- CheckSys.exe病毒的处理
- ASP操作Excel技术总结
- 程序员的八荣八耻
- 原创:在visual studio 2005 中制做 combox (asp.net,C#.net)
- 责任链模式
- 如何写系统分析书
- 自己的程序只运行一次
- 呵呵