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.brWriteU oArray, "13"
...
oFile.brRelease “13” oConn.brCloseFile oFile oEnv.brCloseConnection oConn Set oEnv = Nothing End Sub |