日期:2014-05-17  浏览次数:20899 次

SQL导入EXCEL超过65536条数据时怎么处理,在线等
---初学ASP,多指教---
怎么修改这段代码?
<%
          sub   excel()
          dim   filename,fs,myfile,x
          Set   fs   =   server.CreateObject( "scripting.filesystemobject ")  
          '--假设你想让生成的EXCEL文件做如下的存放  
          filename   =   Server.MapPath( "excel/baobiao.xls ")  
          '--如果原来的EXCEL文件存在的话删除它  
          if   fs.FileExists(filename)   then
          fs.DeleteFile(filename)  
          end   if
          '--创建EXCEL文件
          set   myfile   =   fs.CreateTextFile(filename,true)
       
          if   rs.EOF   and   rs.BOF   then
          else
          dim   strLine,responsestr  
          strLine= " "
          For   each   x   in   rs.fields
          strLine   =   strLine   &   x.name   &   chr(9)
          Next
          '--将表的列名先写入EXCEL  
          myfile.writeline   strLine
          Do   while   Not   rs.EOF  
          strLine= " "
          for   each   x   in   rs.Fields  
          strLine   =   strLine   &   x.value   &   chr(9)  
          next
          '--将表的数据写入EXCEL  
          myfile.writeline   strLine
          rs.MoveNext
          loop
          end   if
       
  end   sub

%>


------解决方案--------------------
有问题吗?
------解决方案--------------------
Excel只能支持65535行
------解决方案--------------------
分成几个文件吧
------解决方案--------------------
循环呀,到60000了再生成新的文件
------解决方案--------------------
mark 一下