- 'Excel connection driver
- Epath = "F:/web/test.xls"
- Estr = "provider = Microsoft. Jet. oledb.4.0; Data Source =" & epath "; extended properties = Excel 8.0"
- Set conn = server. Createobject ("ADODB. Connection ")
- Set rs = server. Createobject ("ADODB. recordset ")
- Set rst = server. Createobject ("ADODB. recordset ")
- Conn. Open estr
- Dim AAA, aaay, Yuhui
- AAA = CINT ("00" & request ("v_amount "))
- Rs. Open "select * from [test $]", Conn, 1, 1
- Yuhui = Rs. getrows (Rs. recordcount)
- Aaay = 0
- For fori = 0 to ubound (Yuhui, 2)-1
- If AAA> = CINT (Yuhui (1, forI) and AAA <CINT (Yuhui (1, forI + 1) Then aaay = Yuhui (2, forI) end if
- Next
- If AAA> = CINT (Yuhui (1, forI) Then aaay = Yuhui (2, forI) end if
- Rs. Close
- SQL = "update Member table set balance = balance +" & AAA "+" & aaay "where username = '" & remark1 "'"
- 'Response. Write SQL
- 'Conn.exe cute ("update Member table set balance = balance +" & AAA & "+" & aaay & "where username = '" & remark1 &"'")
- Conn. Close
- Set conn = nothing
Record set, which is replaced with an array to facilitate the use of table-like data. Because at the beginning, I forgot that the first column is a column and the second column is a row, so the code included for others ~~ For future use.
Redim preserve retains original data and redefines an array (one-dimensional array)