sx_CloseAll

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_CloseAll

VB Declaration

Declare Sub sx_CloseAll Lib "Apollo9.dll" ()

C Declaration

VOID FAR PASCAL sx_CloseAll (VOID);

Description

Close every database and index that is open in the current task. If more than one RDE is being used, sx_CloseAll will properly close every RDE type.

If all files using an RDE are closed, the RDE dynamic link library is unloaded from Windows memory.

 

Tip: Call sx_CloseAll in your program initialization routine where you set up dates, set deleted status, etc. A call to close all files before the code gets started will clean up any file mess you may leave around when you are working in Visual Basic design mode or C/C++ debug mode and are forced to break the program without making a graceful exit. And it doesn't hurt.

VB Example

CustArea = sx_Use("\vb\test\cust.dbf", "cust", READWRITE, SDENTX)

sx_SetFilter "upper(trim(place))='CHINA' .and. left(last, 1)>' '"

sx_GoTop

iRet = sx_CopyFile("\test\test.dbf")

sx_CloseAll

C Example

// destructor

CNamesForm::~CNamesForm()

{

// on form destruct, close files

sx_CloseAll();

}

See Also

sx_Close, sx_CloseIndexes, sx_IndexClose