The code below allows you to delete records or to create new ones.
void AddRecords(void)
{
BufferHandle hBuffer;
Handle4D hText, hPict, hBlob;
char *pText, *pPict, *pBlob;
DataRec data;
short fNb = 1, nbRec=1;
printf("Deleting all records of table : %d\n", fNb);
Check(_4D_SelectAllRecords(hConnect, fNb),"_4D_SelectAllRecords\0");
Check(_4D_DeleteSelectedRecords(hConnect, fNb),"_4D_DeleteSelectedRecords\0");
do {
printf("Adding records to table : %d and record: %d \n", fNb, nbRec);
hBuffer = _4D_CreateBuffer(hConnect, fNb);
data.typ = s_AlphaNumeric;
memcpy(&data.u.s[1], kAlphaData, strlen((char *)kAlphaData));
data.u.s[0] = strlen((char *)kAlphaData);
Check(_4D_AddToBuffer(hConnect, hBuffer, 1, &data),"_4D_AddToBuffer\0");
data.typ = s_Text32K;
hText = Alloc4DHandle(strlen((char *)kTexteData));
pText = (char *) Lock4DHandle(hText);
memcpy(pText, &kTexteData, strlen((char *)kTexteData));
Unlock4DHandle(hText);
data.u.text.TextLen = strlen((char *)kTexteData);
data.u.text.hText = hText;
Check(_4D_AddToBuffer(hConnect, hBuffer, 2, &data),"_4D_AddToBuffer\0");
data.typ = s_Number;
data.u.r.r = 999.999;
Check(_4D_AddToBuffer(hConnect, hBuffer, 3, &data),"_4D_AddToBuffer\0");
data.typ = s_Int16;
data.u.i = 999;
Check(_4D_AddToBuffer(hConnect, hBuffer, 4, &data),"_4D_AddToBuffer\0");
data.typ = s_Int32;
data.u.l = 999;
Check(_4D_AddToBuffer(hConnect, hBuffer, 5, &data),"_4D_AddToBuffer\0");
data.typ = s_Dates;
data.u.d.Day = 27;
data.u.d.Month = 03;
data.u.d.Year = 2000;
Check(_4D_AddToBuffer(hConnect, hBuffer, 6, &data),"_4D_AddToBuffer\0");
data.typ = s_TimeSec;
data.u.tim = 999;
Check(_4D_AddToBuffer(hConnect, hBuffer, 7, &data),"_4D_AddToBuffer\0");
data.typ = s_Bools;
data.u.b = 1;
Check(_4D_AddToBuffer(hConnect, hBuffer, 8, &data),"_4D_AddToBuffer\0");
hPict = Alloc4DHandle(strlen((char *)kAlphaData));
pPict = (char *) Lock4DHandle(hPict);
memcpy(pPict, &kAlphaData, strlen((char *)kAlphaData));
Unlock4DHandle(hPict);
data.typ = s_Pictures;
data.u.pic.PictLen = strlen((char *)kAlphaData);
data.u.pic.hPict = hPict;
Check(_4D_AddToBuffer(hConnect, hBuffer, 9, &data),"_4D_AddToBuffer\0");
hBlob = Alloc4DHandle(strlen((char *)kAlphaData));
pBlob = (char *) Lock4DHandle(hBlob);
memcpy(pBlob, &kAlphaData, strlen((char *)kAlphaData));
Unlock4DHandle(hBlob);
data.typ = s_Blob;
data.u.blob.BlobLen = strlen((char *)kAlphaData);
data.u.blob.hBlob = hBlob;
Check(_4D_AddToBuffer(hConnect, hBuffer, 10, &data),"_4D_AddToBuffer\0");
Check(_4D_NewRecord(hConnect, hBuffer),"_4D_NewRecord\0");
Free4DHandle(hText);
Free4DHandle(hPict);
Free4DHandle(hBlob);
Free4DHandle((Handle4D) hBuffer);
nbRec ++;
} while ( nbRec < 4 );
}