記錄集,換成數組/rs.getRows()/redim Preserve 保留原有資料

來源:互聯網
上載者:User
 

  1. 'Excel串連驅動
  2. Epath="F:/web/test.xls"
  3. Estr="provider=Microsoft.Jet.OLEDB.4.0; Data Source="&Epath";Extended Properties=Excel 8.0"
  4. Set conn = Server.Createobject("ADODB.Connection")
  5. set rs    =server.CreateObject("adodb.recordset")
  6. set rsT    =server.CreateObject("adodb.recordset")
  7. conn.open   Estr
  8. dim aaa,aaay ,yuhui
  9. aaa=Cint("00"&request("v_amount") )
  10. rs.open "select * from [test$]",conn,1,1
  11. yuhui=rs.getRows(rs.recordcount)
  12. aaay=0
  13. for fori=0 to ubound(yuhui,2)-1
  14.   if aaa>=Cint(yuhui(1,fori)) and aaa <Cint(yuhui(1,fori+1)) then aaay=yuhui(2,fori) end if
  15. next
  16. if aaa>=Cint(yuhui(1,fori)) then aaay=yuhui(2,fori) end if 
  17. rs.close 
  18. sql="update 會員表 set 餘額=餘額+"&aaa"+"&aaay" where 使用者名稱='"&remark1"'"
  19. 'response.Write sql
  20. 'conn.execute("update 會員表 set 餘額=餘額+"&aaa&"+"&aaay&" where 使用者名稱='"&remark1&"'") 
  21. conn.close 
  22. set conn=nothing

 

 

記錄集,換成數組,便於表狀資料的使用。因為開始時忘了第一列是列,第二列是行,所以收錄下給別人的代碼~~以備後用。

 

redim Preserve 保留原有資料,重定義數組(一維數組)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.