Share via


Fields property

Returns the Fields collection for the DataSet or Recordset object. Read-only.

Applies to

Objects:  DataSet, Recordset

Syntax

object.Fields

Parameters

Part Description
object Required. An expression that returns a DataSet or Recordset object.

Example

  
    Sub GetAllFieldNames()

  Dim objApp As New MapPoint.Application
  Dim objDataSet As MapPoint.DataSet
  Dim objFld As MapPoint.Field
  Dim strFldNames As String

  'Set up the application
  objApp.Visible = True
  objApp.UserControl = True

  'Open a sample file and get the data set in the file
  Set objDataSet = objApp.OpenMap(objApp.Path & "\Samples\Clients.ptm").DataSets("Clients")

  'Loop through all available fields for their names
  For Each objFld In objDataSet.Fields
    strFldNames = strFldNames & objFld.Name & vbCrLf
  Next

  MsgBox "DataSet field names: " & vbCrLf & strFldNames

End Sub