Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

DBCloseArea

DBCloseArea() --> Nil

Closes a work area and releases its resources.

DBCloseAreaAdvPL
01 · OVERVIEW

Overview

DBCloseArea acts on the current alias in its call context. Documentation describes flushing pending updates and releasing locks and resources. Closing an area neither deletes the file nor rolls back changes. The example qualifies the owned alias instead of closing an arbitrary caller area; do not close an alias borrowed from the framework. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

DBCloseArea() --> Nil

Return value

Nil; not a logical success indicator.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed325()
    // EDTRB must belong to this routine with no later use.
    If Select("EDTRB") > 0
        EDTRB->(DBCloseArea())
    EndIf
Return Nil
Expected result

Test alias closed without deleting its physical file. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check RDD, alias and pending operations. Navigation can flush updates; preserve context under the caller contract and handle errors in the complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. DBCloseArea. TDN. Accessed on 2026-10-26.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha