Writes an item to the D3 file associated with the clsD3File object, overwriting the previous contents of the item, maintaining the lock on the item.
object.brWriteU oDynArrayItem, sItemName
Parameter | Description |
---|---|
object | An object variable that represents a clsD3File object. |
oDynArrayItem | An object variable that represents a clsD3DynamicArray object that contains the item to be written. |
sItemName | A String specifying the item-id of the item to write. |
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". Set 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.brWriteUoArray, "13" ... oFile.brRelease “13” oConn.brCloseFile oFile oEnv.brCloseConnection oConn Set oEnv = Nothing End Sub
writeu