Asp ado getrows () usage demonstration by shawl. Qiu

Source: Internet
Author: User

Asp ado getrows () usage demonstration by shawl. Qiu

Note:
This article demonstrates how to use ADO getrows () to display data.

Shown:

Quote:

Default by 0
4 fields 4 records

Line: 0 field 0: 1-|-Field 1: IT terminology-|-Field 2: 2006-5-12-|-Field 3: 20:46:16-|-field 4: 1
Line: 1 Field 0: 2-|-Field 1: vocabulary-|-Field 2: 2006-5-16-|-Field 3: 13:23:00-|-field 4: 888
Line: 2 Field 0: 3-|-Field 1: political term-|-Field 2: 2006-5-16-|-Field 3: 17:36:11-|-field 4: 60
Line: 3 field 0: 4-|-Field 1: natianadi-|-Field 2: 2006-5-16-|-Field 3: 17:50:52-|-field 4: 999
Line: 4 field 0: 5-|-Field 1: commercial term-|-Field 2: 2006-5-25-|-Field 3: 18:37:11-|-field 4: 20

Shawl. Qiu
2006-09-08
Http://blog.csdn.net/btbtd

Main content:

    Linenum

  1. <%
  2. Dim RS, AR, fldar
  3. Fldar = array ("sbid", "sbcat ")'
  4. 'Fldar = array ("sbcat", "sbid ")'
  5. Call fcreaters (RS) 'Call the create recordset Function
  6. With RS
  7. . Open "select * From vt1", Conn
  8. 'Assign the array value to the AR variable.
  9. '''''''''''''''''''''''''''''''''''''''' ''''''''''
  10. 'Ar =. getrows (10, fldar) '(select 10 records. [select all records for null values]. The function is unknown. Select an array of fields. [select all fields for null values])
  11. AR =. getrows 'assigns the value obtained by getrows to the variable ar
  12. '''''''''''''''''''''''''''''''''''''''' ''''''''''
  13. End
  14. Call fclosers (RS) 'Call to disable the recordset Function
  15. Dim rs1_, rstotal
  16. Rsund = ubound (AR, 1) 'indicates the total number of table fields, starting with 0.
  17. Rstotal = ubound (AR, 2) 'indicates the total number of table records, starting with 0.
  18. Response. Write "default by 0 <br/>"
  19. Response. Write rs1_& "fields" & rstotal & "records <p/>" 'total number of printed fields and total number of records
  20. Dim item, temp
  21. For item = 0 to rstotal all records are output cyclically
  22. Response. Write "line :"
  23. Response. Write item
  24. Response. Write "& nbsp ;"
  25. For temp = 0 to rsrent' loop outputs data of all fields
  26. Response. Write "field"
  27. Response. Write temp
  28. Response. Write ":"
  29. Response. Write AR (temp, item) '(field number, row number)
  30. If temp <rsrentthen response. Write "<font color =" red ">-|-</font>"
  31. Next 'shawl. Qiu Code'
  32. Response. Write "<br/>"
  33. Next
  34. Function fcreaters (RS)
  35. Set rs = Createobject ("ADODB. recordset ")
  36. End Function
  37. Function fclosers (RS)
  38. Rs. Close
  39. Set rs = nothing
  40. End Function
  41. %>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.