⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stuinfotoexcel.asp

📁 成绩管理代码 采取的研究方法:采用网络编程技术
💻 ASP
字号:
 <%
  if session("type")<>"999" then 
response.write "<br><br>对不起,您没有权限使用导入excel的权限!"
response.end
end if
 Response.ContentType = "application/vnd.ms-excel"
   set conntemp=server.createobject("adodb.connection") 
   cnpath="DBQ=" & server.mappath("../data/yzbzcj2007.mdb") 
   conntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath 
   sql="select * from stuinfo"
   set RS=conntemp.execute(sql) 
    %> 
   <TABLE BORDER=1><tr>
   <% 
   ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   ' % Loop through Fields Names and print out the Field Names 
   ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   j = 2 'row counter 
   'For i = 1 to RS.Fields.Count - 7 
   Response.Write   "<td><B>学号<B></td><td><B>姓名<B></td><td><B>性别<B></td><td><B>民族<B></td><td><B>出生日期<B></td><td><B>级部<B></td><td><B>班级<B></td><td><B>入学日期<B></td><td><B>家长姓名<B></td><td><B>联系电话<B></td><td><B>家庭住址<B></td><td><B>备注<B></td>"
   'next
   %> </tr>
   <% 
   ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   ' % Loop through rows, displaying each field 
   ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   Do While Not RS.EOF 
   %> 
   <TR> 
   <% For i = 1 to RS.Fields.Count - 7 
   %> 
   <TD VALIGN=TOP><% = RS(i) %></TD> 
   <% Next %> 
   </TR>  <% 
   RS.MoveNext 
   j = j + 1 
   Loop 
   ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   ' % Make sure to close the Result Set and the Connection object 
   ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   RS.Close %>
  
   </TABLE> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -