通讯簿导航按钮
通讯簿应用程序显示网页底部的导航按钮。 可以通过选择第一行或最后一行数据或与当前所选内容相邻的行,使用导航按钮在 HTML 网格中显示的数据中导航。
重要
从 Windows 8 和 Windows Server 2012 开始,RDS 服务器组件不再包含在 Windows 操作系统中(有关详细信息,请参阅 Windows 8 和 Windows Server 2012 兼容性指南)。 RDS 客户端组件将在将来的 Windows 版本中删除。 避免在新开发工作中使用此功能,并计划修改当前使用此功能的应用程序。 使用 RDS 的应用程序应迁移到 WCF 数据服务。
导航子程序
通讯簿应用程序包含多个过程,允许用户单击 第一、下一、上一,以及 最后一 按钮移动数据。
例如,单击 “第一”按钮将激活 VBScript First_OnClick 子过程。 该过程执行 MoveFirst 方法,该方法使第一行数据成为当前选择。 单击“最终”按钮将激活 Last_OnClick 子过程,该过程调用 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)