共用方式為


通訊簿導覽按鈕

通訊錄應用程式會顯示網頁底部的瀏覽按鈕。 您可以使用導覽按鈕來流覽 HTML 方格顯示中的數據,方法是選取數據的第一列或最後一列,或與目前選取範圍相鄰的數據列。

重要

從 Windows 8 和 Windows Server 2012 開始,RDS 伺服器元件已不再包含在 Windows 作業系統中(如需詳細資訊,請參閱 Windows 8 和 Windows Server 2012 兼容性 Cookbook)。 RDS 用戶端元件將在未來的 Windows 版本中移除。 請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。 使用 RDS 的應用程式應該移至 WCF Data Service

通訊簿應用程式包含數個程式,可讓用戶點擊 FirstNextPrevious,以及 最後 按鈕來瀏覽資料。

例如,按兩下 [First] 按鈕會啟動 VBScript First_OnClick Sub 程式。 此程式會執行 MoveFirst 方法,讓第一個數據列成為目前選取範圍。 按一下 [上次] 按鈕會啟動 Last_OnClick Sub 程式,此程式會叫用 MoveLast 方法,使數據的最後一列成為當前選取。 其餘的瀏覽按鈕會以類似的方式運作。

' Move to the first record in the bound Recordset.  
Sub First_OnClick  
   DC1.Recordset.MoveFirst  
End Sub  
  
' Move to the next record from the current position   
' in the bound Recordset.  
Sub Next_OnClick  
   If Not DC1.Recordset.EOF Then    ' Cannot move beyond bottom record.  
      DC1.Recordset.MoveNext  
      Exit Sub  
   End If     
End Sub  
  
' Move to the previous record from the current position in the bound   
' Recordset.  
Sub Prev_OnClick  
   If Not DC1.Recordset.BOF Then    ' Cannot move beyond top record.  
      DC1.Recordset.MovePrevious  
      Exit Sub  
   End If  
End Sub  
  
' Move to the last record in the bound Recordset.  
Sub Last_OnClick  
   DC1.Recordset.MoveLast  
End Sub  

另請參閱

DataControl 物件(RDS)
MoveFirst、MoveLast、MoveNext 和 MovePrevious 方法 (RDS)