sx_AppendBlank

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_AppendBlank

VB Declaration

Declare Sub sx_AppendBlank Lib "Apollo9.dll" ()

C Declaration

VOID FAR PASCAL sx_AppendBlank (VOID);

Description

Appends a new blank record to the current database. This procedure or sx_Append must be called whenever a new record is to be added to the database. A blank record added via sx_AppendBlankEx is automatically locked.

 

The standard sx_Append and sx_AppendBlank procedures do not return a value to the applications programmer. In fact, if a lock contention occurs with the non-extended procedures, the user must wait for the lock to be released before the record is appended. This extended function will return an error code if ANY error is encountered, so that the application programmer may deal with it.

 

VB Example

' if adding, append a blank

If EditMode = 2 Then

sx_AppendBlank

End If

 

If sx_Rlock(sx_RecNo()) Then

sx_Replace "customer", R_CHAR, ByVal RTrim$((tCust.Text))

sx_Replace "last", R_CHAR, ByVal RTrim$((tLast.Text))

sx_Replace "notes", R_MEMO, ByVal RTrim$((tMemo.Text))

sx_Commit

sx_Unlock sx_RecNo()

End If

C Example

void CNamesForm::OnButtonAdd()

{

// re-enable database linkage

m_date->SetNumProperty("Unlink", FALSE);

 

// set switch on, append blank, and then edit

bAddMode = TRUE;

sx_AppendBlank(); // leaves rec locked

OnButtonEdit();

}

See Also

sx_AppendBlankEx, sx_Append, sx_AppendEx, sx_Commit, sx_PutRecord, sx_Replace