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

📄 asp实现从sql server导数据到access或excel文件 .htm

📁 较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0054)http://www.51base.com/article/view_article.asp?id=5535 -->
<HTML lang=zh-cn><HEAD><TITLE>NB联盟</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK 
href="NB联盟7.files/style.css" rel=stylesheet>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY><!-- start page body -->
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 class=td id=position 
width=773>
  <TBODY>
  <TR>
    <TD class=shadow colSpan=2 height=20 width=262>&nbsp;&nbsp;<A 
      href="http://www.51base.com/"><IMG border=0 
      src="NB联盟7.files/logo1.gif"></A> </TD>
    <TD align=right width=505>
      <P align=left></P></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 id=main width=770>
  <TBODY>
  <TR>
    <TD class=tdlbr vAlign=top>
      <TABLE align=center border=0 cellPadding=0 cellSpacing=0 id=welcome 
      style="TABLE-LAYOUT: fixed" width="98%">
        <TBODY>
        <TR>
          <TD style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" 
            vAlign=top><FONT color=red><B>文章标题</B></FONT><FONT color=red><B>: 
            ASP实现从SQL Server导数据到Access或Excel文件 </B></FONT>
            <HR noShade SIZE=1>
            &nbsp;&nbsp;&nbsp;&nbsp;方法其实很简单:需要在SQL&nbsp;Server连接中嵌套一个access连接,然后逐条&nbsp; 
            <BR>写入就可以了。&nbsp; 
            <BR><BR>&lt;%set&nbsp;Conn&nbsp;=&nbsp;Server.CreateObject("ADODB.Connection")&nbsp; 
            <BR>Conn.Open&nbsp;"driver={SQL&nbsp;server};server=mamaco;uid=linner;pwd=123;dat&nbsp; 
            <BR>abase=linner"&nbsp; 
            <BR>sql="select&nbsp;*&nbsp;from&nbsp;scjh"&nbsp; 
            <BR>set&nbsp;rs=conn.execute&nbsp;(sql)%&gt;&nbsp; 
            <BR>&lt;%set&nbsp;Conn1&nbsp;=&nbsp;Server.CreateObject("ADODB.Connection")&nbsp; 
            <BR>param&nbsp;=&nbsp;"driver={Microsoft&nbsp;Access&nbsp;Driver&nbsp;(*.mdb)}"&nbsp; 
            <BR>conn.Open&nbsp;param&nbsp;&amp;&nbsp;";dbq="&nbsp;&amp;&nbsp;Server.MapPath("scjh.mdb")&nbsp; 
            <BR>conn1.execute("delete&nbsp;from&nbsp;scjh")%&gt;&nbsp; 
            <BR>&lt;%do&nbsp;while&nbsp;not&nbsp;rs.eof%&gt;&nbsp; 
            <BR>&lt;%dim&nbsp;ktdh,scph,scts,jhqtsj,yhxdsj,yxj,rwbh&nbsp; 
            <BR>ktdh=rs("ktdh")&nbsp; <BR>scph=rs("scph")&nbsp; 
            <BR>scts=rs("scts")&nbsp; <BR>jhqtsj=rs("jhqtsj")&nbsp; 
            <BR>yhxdsj=rs("yhxdsj")&nbsp; <BR>yxj=rs("yxj")&nbsp; 
            <BR>rwbh=rs("rwbh")&nbsp; <BR>%&gt;&nbsp; 
            <BR>&lt;%sql1="insert&nbsp;into&nbsp;scjh(ktdh,scph,scts,jhqtsj,yhxdsj,yxj,rwbh)&nbsp;values&nbsp; 
            <BR><BR><BR><BR>('"&amp;&nbsp;ktdh&nbsp;&amp;"','"&nbsp;&amp;&nbsp;scph&nbsp;&amp;&nbsp;"',"&nbsp;&amp;&nbsp;scts&nbsp;&amp;&nbsp;",'"&amp;jhqtsj&amp;"','"&amp;yhxdsj&amp;"',"&amp;&nbsp; 
            <BR><BR><BR><BR>&nbsp;yxj&nbsp;&amp;","&nbsp;&amp;&nbsp;rwbh&nbsp;&amp;")"&nbsp;&nbsp; 
            <BR>conn1.execute&nbsp;(sql1)%&gt;&nbsp; <BR>&lt;%rs.movenext&nbsp; 
            <BR>loop&nbsp; <BR>conn1.close&nbsp; <BR>conn.close%&gt;&nbsp; 
            <BR>&lt;%response.redirect&nbsp;"/download/scjh.mdb"%&gt;&nbsp; 
        </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
<TABLE align=center border=0 cellPadding=2 cellSpacing=0 id=footer width=770>
  <TBODY>
  <TR>
    <TD align=middle class=tdt>
      <P align=center></P></TD></TR></TBODY></TABLE><BR></BODY></HTML>

⌨️ 快捷键说明

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