Locks and reads an item from the D3 file associated with the clsD3File object, returning the item as a clsD3DynamicArray.
Set oDynArray = object.brReadU( sItemName)
Parameter | Description |
---|---|
oDynArray | An object variable that represents a clsD3DynamicArray object containing the item read from the D3 file. |
object | An object variable that represents a clsD3File object. |
sItemName | A String specifying the item-id of the item to retrieve. |
The brReadU method returns the exception d3SrvErr_Lock if the lock cannot be obtained because some other process has the file or item locked already.
Sub Main() Dim oEnv As New clsD3Environment Dim oConn As clsD3Connection Dim oFile As clsD3File Dim oArray 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.brColumn("contactname") lTitle = oFile.brColumn("contacttitle") ' Read the record for customer "13". vSet oArray = oFile.brReadU("13") ' Change the attributes in the dynamic array. oArray.brReplaceStr "Bob Smith", lName oArray.brReplaceStr "Vice President", lTitle ' Write the record back. oFile.brWrite oArray, "13" oConn.brCloseFile oFile oEnv.brCloseConnection oConn Set oEnv = Nothing End Sub
readu