xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DbCloseAll()

Close all open files in all work areas.

Syntax

DbCloseAll() --> NIL

Return

The return value is always NIL.

Description

The function closes all open databases and all associated files like index or memo files. In addition, all format files are closed and work area #1 is selected as the current work area.

Info

See also:CLOSE, DbCloseArea(), DbUseArea(), SELECT, Select(), USE, Used()
Category: Database functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates closing of all databases with one
// function call.

   PROCEDURE Main()

      USE Test NEW
      ? Select()                       // result: 1

      USE Test1 NEW
      ? Select()                       // result: 2

      ? (1)->(Used())                  // result: .T.
      ? (2)->(Used())                  // result: .T.

      DbCloseAll()

      ? Select()                       // result: 1
      ? (1)->(Used())                  // result: .F.
      ? (2)->(Used())                  // result: .F.
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe