一聚教程网:一个值得你收藏的教程网站

热门教程

如何把access数据导出excel数据代码

时间:2022-06-29 14:26:43 编辑:袖梨 来源:一聚教程网

 


   
   
   
   
   
       
           
               
               
               
               
               
               
               
               
               
               
                <%
                response.write""
                response.write""
                %>
               
           
            <%
                If Not result.eof then
                Do While Not result.eof
            %>
           
               
               
               
               
               
               
               
               
               
               
           
      
      <%
                result.movenext
                loop
                End if
                result.close
                Set result=nothing
                conn.close
                Set conn=Nothing
            %>


    
 

部门
工号
姓名
培训号
培训内容
培训类别
开始日期
结束日期
学时
学分
"&coursedept&"
"&strsql&"
<%=result("memberdept")%><%=result("m.memberid")%><%=result("membername")%><%=result("c.courseid")%><%=result("coursename")%><%=result("coursetype")%><%=result("coursebegindate")%><%=result("courseenddate")%><%=result("courseperiod")%><%=result("coursescore")%>

 
 
 

  <%
  if request.Form("coursedept") then
        coursedept=request.form("coursedept")
        coursetype=request.form("coursetype")
        coursebegindate=request.form("coursebegindate")
        courseenddate=request.form("courseenddate")
        db="xf.mdb"
        teacher="老师"
       
       
        strsql="select * from XF_Member m, XF_Course c, XF_Score s where (s.courseid=c.courseid) and (s.memberid=m.memberid) and (s.membertype='"&teacher&"') "
        If coursedept<>"" Then
        strsql=strsql&" and (c.coursedept='"&coursedept&"')"
        End If
        Set conn = Server.CreateObject("ADODB.Connection")
        connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
        conn.Open connstr
       
        Set result=conn.execute(strsql)
       
        response.ContentType="application/vnd.ms-excel"
        'response.write "strsql:"+strsql+"dept:"+coursedept
  end if


        
        %>

热门栏目