brCloseFile method

Closes the D3 file associated with the specified clsD3File object and destroys the object.

Syntax

object.brCloseFile oFile

Parameters

Parameter Description
object An object variable that represents a clsD3Connection object.
oFile An object variable that represents the clsD3File object to be destroyed.

Remarks

  • Attempting to use a clsD3File object that is closed results in a run-time error.

  • Any attempt to close a clsD3File object that has been closed is ignored.

Example

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.brCloseFileoFile
   oEnv.brCloseConnection oConn
   Set oEnv = Nothing
End Sub

FlashBASIC reference

close