Propriedade Field.DataUpdatable (DAO)
Aplica-se ao: Access 2013, Office 2013
Retorna um valor que indica se os dados no campo representados por um objeto Field são atualizáveis.
Sintaxe
expressão . DataUpdatable
expressão Uma variável que representa um objeto de Campo.
Comentários
Utilize essa propriedade para determinar se você pode alterar a configuração da propriedade Value de um objeto Field. Essa propriedade é sempre False em um objeto Field cuja propriedade Attributes é dbAutoIncrField.
Você pode usar a propriedade DataUpdatable nos objetos Field que foram acrescentados à coleção Fields dos objetos QueryDef, Recordset e Relation, mas não à coleção Fields dos objetos Index ou TableDef.
Exemplo
Este exemplo demonstra a propriedade DataUpdatable utilizando o primeiro campo de seis Recordsets diferentes. A função DataOutput é exigida para que este procedimento seja executado.
Sub DataUpdatableX()
Dim dbsNorthwind As Database
Dim rstNorthwind As Recordset
Set dbsNorthwind = OpenDatabase("Northwind.mdb")
With dbsNorthwind
' Open and print report about a table-type Recordset.
Set rstNorthwind = .OpenRecordset("Employees")
DataOutput rstNorthwind
' Open and print report about a dynaset-type Recordset.
Set rstNorthwind = .OpenRecordset("Employees", _
dbOpenDynaset)
DataOutput rstNorthwind
' Open and print report about a snapshot-type Recordset.
Set rstNorthwind = .OpenRecordset("Employees", _
dbOpenSnapshot)
DataOutput rstNorthwind
' Open and print report about a forward-only-type Recordset.
Set rstNorthwind = .OpenRecordset("Employees", _
dbOpenForwardOnly)
DataOutput rstNorthwind
' Open and print report about a Recordset based on
' a select query.
Set rstNorthwind = _
.OpenRecordset("Current Product List")
DataOutput rstNorthwind
' Open and print report about a Recordset based on a
' select query that calculates totals.
Set rstNorthwind = .OpenRecordset("Order Subtotals")
DataOutput rstNorthwind
.Close
End With
End Sub
Function DataOutput(rstTemp As Recordset)
With rstTemp
Debug.Print "Recordset: " & .Name & ", ";
Select Case .Type
Case dbOpenTable
Debug.Print "dbOpenTable"
Case dbOpenDynaset
Debug.Print "dbOpenDynaset"
Case dbOpenSnapshot
Debug.Print "dbOpenSnapshot"
Case dbOpenForwardOnly
Debug.Print "dbOpenForwardOnly"
End Select
Debug.Print " Field: " & .Fields(0).Name & ", " & _
"DataUpdatable = " & .Fields(0).DataUpdatable
Debug.Print
.Close
End With
End Function