sx_Unlock

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Unlock

VB Declaration

Declare Sub sx_Unlock Lib "Apollo9.dll"

(ByVal lRecNum As Long)

C Declaration

VOID FAR PASCAL sx_Unlock

(LONG lRecNum);

Description

Removes record and/or file locks from the current work area.

Parameters

lRecNum: Indicates the specific record number to be unlocked. Passing a zero (0) unlocks all records and removes any file lock.

Note: This parameter is not currently used to indicate the specific record to be unlocked, but the sx_RecNo value should be used to insure future compatibility, where this support may be added.

VB Example

If sx_Rlock(sx_RecNo()) Then

sx_Replace "name", R_CHAR, ByVal RTrim$((BoxName.Text))

sx_Commit

sx_Unlock sx_RecNo()

Else

MsgBox "Record lock failed"

End If

C Example

// save the record

void CNamesForm::OnButtonSave()

{

sx_Commit();

sx_Unlock(sx_RecNo());

if (!bAddMode)

m_sdebrowse->SetNumProperty("Action", BRW_ACT_REFRESHLINE);

// else refresh display on add  

else

{

// reset add switch

bAddMode = FALSE;

 

// if scroll bar present, refresh all

if (m_sdebrowse->GetNumProperty("VBarDim"))

m_sdebrowse->SetNumProperty("Action", BRW_ACT_REFRESHALL);

 

// otherwise, gotop

else

m_sdebrowse->SetNumProperty("Action", BRW_ACT_GOTOP);

}

m_sdebrowse->SetFocus();

return;

}

See Also

sx_Flock, sx_Locked, sx_Rlock, sx_SetLockTimeout