Hướng dẫn ASP

TRANG CHỦ ASP

Hướng dẫn WP

Giới thiệu trang web Dao cạo trang web Bố cục trang web Thư mục Trang web WebPages Global Biểu mẫu trang web Đối tượng trang web Tệp trang web Cơ sở dữ liệu trang web Người trợ giúp Trang web WebPages WebGrid Biểu đồ trang web Email các trang web Bảo mật trang web Xuất bản trang web Ví dụ về trang web Các lớp trang web

ASP.NET Razor

Giới thiệu Razor Cú pháp dao cạo Các biến Razor C # Dao cạo C # Vòng Dao cạo C # Logic Biến VB Razor Vòng lặp VB Razor Razor VB Logic

ASP cổ điển

Giới thiệu ASP Cú pháp ASP Biến ASP Thủ tục ASP Điều kiện ASP ASP Looping Biểu mẫu ASP ASP Cookies Phiên ASP Ứng dụng ASP ASP #include ASP Global.asa ASP AJAX ASP e-mail Ví dụ về ASP

Tham chiếu ASP

Chức năng ASP VB Từ khóa ASP VB Đáp ứng ASP Yêu cầu ASP Ứng dụng ASP Phiên ASP Máy chủ ASP Lỗi ASP ASP FileSystem Dòng văn bản ASP Ổ ASP Tệp ASP Thư mục ASP Từ điển ASP ASP AdRotator ASP BrowserCap Liên kết nội dung ASP Công cụ xoay vòng nội dung ASP Tham khảo nhanh ASP

Hướng dẫn ADO

Giới thiệu ADO Kết nối ADO ADO Recordset Hiển thị ADO Truy vấn ADO ADO Sắp xếp ADO Thêm Cập nhật ADO ADO Xóa ADO Demo Tăng tốc ADO

Đối tượng ADO

Lệnh ADO Kết nối ADO Lỗi ADO Trường ADO Tham số ADO ADO thuộc tính Bản ghi ADO ADO Recordset Luồng ADO ADO DataTypes

Phương pháp ADO GetRows


❮ Tham chiếu đối tượng tập bản ghi hoàn chỉnh

Phương thức GetRows sao chép nhiều bản ghi từ một đối tượng Recordset vào một mảng hai chiều.

Cú pháp

vararray=objRecordset.GetRows(rows,start,fields)

Parameter Description
rows Optional. A GetRowsOptionEnum value that specifies the number of records to retrieve. Default is adGetRowsRest.

Note: If you omit this argument it will retrieve all records in the Recordset

start

Optional. What record to start on, a record number or a BookmarkEnum value

fields Optional. If you want to specify only the fields that the GetRows call will return, it is possible to pass a single field name/number or an array of field names/numbers in this argument

Thí dụ

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("northwind.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn

'The first number indicates how many records to copy
'The second number indicates what recordnumber to start on
p=rs.GetRows(2,0)
rs.close
conn.close

'This example returns the value of the first
'column in the first two records
response.write(p(0,0))
response.write("<br>")
response.write(p(0,1))

'This example returns the value of the first
'three columns in the first record
response.write(p(0,0))
response.write("<br>")
response.write(p(1,0))
response.write("<br>")
response.write(p(2,0))
%>

Giá trị GetRowsOptionEnum

Constant Value Description
adGetRowsRest -1 Retrieves the rest of the records in the Recordset object

Giá trị BookmarkEnum

Constant Value Description
adBookmarkCurrent 0 Starts at the current record
adBookmarkFirst 1 Starts at the first record
adBookmarkLast 2 Starts at the last record

❮ Tham chiếu đối tượng tập bản ghi hoàn chỉnh