Returns the attribute number of the specified attribute-defining item of the D3 file associated with the clsD3File object.
lValue = object.brAttribute(sName)
| Parameter | Description |
|---|---|
| lValue | The return value is a Long data type indicating the attribute number. |
| object | An object variable that represents a clsD3File object. |
| sName | A String that specifies the attribute-defining item. |
If the requested attribute-defining item is not found in the D3 file, the method returns the exception d3SrvErr_BadCol.
The brAttribute method and the brColumn method return the same results.
Sub Main()
Dim oEnv As New clsD3Environment
Dim oConn As clsD3Connection
Dim oFile As clsD3File
Dim oDynArray As clsD3DynamicArray
Dim lName As Long
Dim lTitle As Long
Set oConn = oEnv.brOpenConnection("ODBC", "Production")
’Open the file
Set oFile = oConn.brOpenFile("Customers")
’Resolve attribute names
lName = oFile.brAttribute("contactname")
lTitle = oFile.brAttribute("contacttitle")
’ Read the record for customer "13"
Set oDynArray = oFile.brReadU("13")
’ Change the attributes in the dynamic array
oDynArray.brReplaceStr "Al Gore", lName
oDynArray.brReplaceStr "Vice President", lTitle
’Write the record back
oFile.brWrite oDynArray, "13"
oConn.brCloseFile oFile
oEnv.brCloseConnection oConn
End Sub