久久久久久久性爱潮,国产又粗又猛又爽又黄下载视频,尤物国产在线一区视频,欧美日本国产在线不卡

<sup id="4uqqy"><ol id="4uqqy"></ol></sup>
  • <th id="4uqqy"></th>

      • <strike id="4uqqy"><nobr id="4uqqy"><ins id="4uqqy"></ins></nobr></strike><sup id="4uqqy"></sup><strong id="4uqqy"><u id="4uqqy"></u></strong>
        <sub id="4uqqy"></sub>

          綠色資源網(wǎng):您身邊最放心的安全下載站! 最新軟件|熱門排行|軟件分類|軟件專題|廠商大全

          綠色資源網(wǎng)

          技術(shù)教程
          您的位置:首頁網(wǎng)絡(luò)編程Asp編程 → asp將access數(shù)據(jù)導(dǎo)出為excel電子表的方法

          asp將access數(shù)據(jù)導(dǎo)出為excel電子表的方法

          我要評論 2010/05/11 16:03:04 來源:綠色資源網(wǎng) 編輯:綠色軟件站 [ ] 評論:0 點擊:747次

          有一個客戶要求后臺生成大數(shù)據(jù)量(每次生成幾萬條)的會員卡號及密碼,金額等。生成的會員卡號及密碼要印制在卡上對會員發(fā)放。生成大量數(shù)據(jù)在庫中,印制卡片的廠家要拿到數(shù)據(jù)進行印制怎么辦呢?

          于是我想到用代碼將access中的數(shù)據(jù)生成Excel表格導(dǎo)出。打印這樣不就可以了嗎?在網(wǎng)上查找相關(guān)資料可都不盡如我意,就自己動手寫了這個程序。現(xiàn)放出來供大家分享!

          下面為代碼:

          以下為引用的內(nèi)容:

          <!--#include file="../conn.asp"-->
          <%
          if session("china_admin")="" then response.redirect "login.asp"
          dbpath="../"
          dblink
          dim filename,fs,myfile,x,m,n,o,link
          Set fs = server.CreateObject("scripting.filesystemobject")

          Set rs = Server.CreateObject("ADODB.Recordset")
          session("sql") = "select * from china_car"
          rs.Open session("sql"),conn,1,1
          n=1

          '==================================================================
          '==============================================================建立excel文件系統(tǒng)
          filename = Server.MapPath("car/CarTable"&n&".xls") '這個是為了方便,新建一個CAR的文件夾,這個可以自己設(shè)啦
          if fs.FileExists(filename) then'如果文件存在,覆蓋它。
          fs.DeleteFile(filename)
          end if
          set myfile = fs.CreateTextFile(filename,true)

          '========================================================================

          dim strLine,responsestr
          strLine=""

          dim work,j,i
          str="序號|卡號|密碼|積分數(shù)|金額"  '這個根據(jù)你的access數(shù)據(jù)表字段設(shè)置。
          work=split(str,"|")
          j=ubound(work)
          i=0
          o=0
          do while not i>j
          strLine= strLine & work(i) & chr(9)
          i=i+1
          loop

          myfile.writeline strLine
          Do while Not rs.EOF
          o=o+1
          m=20000


          strLine=""

          for each x in rs.Fields
          strLine= strLine & x.value & chr(9)
          if o>=m*n then
          n=n+1
          filename = Server.MapPath("car/CarTable"&n&".xls") '這個可以自己設(shè)啦
          if fs.FileExists(filename) then'如果文件存在,覆蓋它。
          fs.DeleteFile(filename)
          end if
          set myfile = fs.CreateTextFile(filename,true)
          end if
          next

          myfile.writeline strLine

          rs.MoveNext
          loop

          rs.Close
          set rs = nothing
          conn.close
          set conn = nothing
          set myfile = nothing
          Set fs=Nothing
          ExcelPath="car/CarTable"&n&".xls"
          response.Write "導(dǎo)出成功  "
          response.write("<a href='" & server.URLEncode(ExcelPath) & "'><font=red>下載</font></a>")

          %>

          關(guān)鍵詞:asp,access數(shù)據(jù),excel電子表

          閱讀本文后您有什么感想? 已有 人給出評價!

          • 0 歡迎喜歡
          • 0 白癡
          • 0 拜托
          • 0 哇
          • 1 加油
          • 0 鄙視