MaxRecords 屬性

此頁沒有內(nèi)容條目
內(nèi)容

expandtri全部顯示

指定由以下各項(xiàng)所返回的最大記錄數(shù):

?查詢,將來自 ODBC 數(shù)據(jù)庫的數(shù)據(jù)返回到 Microsoft Access 數(shù)據(jù)庫 (.mdb) 中。
?視圖,將來自 SQL 數(shù)據(jù)庫的數(shù)據(jù)返回到 Access 項(xiàng)目 (.adp) 中。

expression.MaxRecords

expression     必需。返回“應(yīng)用于”列表中的一個(gè)對(duì)象的表達(dá)式。

說明

MaxRecords 屬性設(shè)置值為 Long Integer 值,表示返回的記錄條數(shù)。

在 Microsoft Access 數(shù)據(jù)庫中,可以使用查詢的屬性表Visual Basic 設(shè)置該屬性。

在 Visual Basic 中設(shè)置該屬性時(shí),請(qǐng)使用 ADO MaxRecords 屬性。

記錄按照查詢的 ORDER BY 子句所指定的順序返回。

如果因系統(tǒng)資源有限而禁止返回大量記錄,則可以使用 MaxRecords 屬性。

示例

要返回窗體的 MaxRecords 屬性,可以使用下面的示例:

Dim l As Long

l = Forms(formname).MaxRecords

要設(shè)置 MaxRecords 屬性,可以使用下面的示例:

Forms(formname).MaxRecords = numrecords

其中 formname 是窗體的名稱,表示為 String 型,而 numrecords 為 Long Integer 型值,表示將返回的記錄數(shù)。