AddVRecord Add a new variable-length data record, and its corresponding key values, to ISAM files. Short Name ADDVREC() Type ISAM function variable length record Declaration COUNT AddVRecord(COUNT datno, pVOID recptr, VRLEN varlen) Description AddVRecord() adds the data record with length in bytes given by varlen and pointed to by recptr to data file number datno. It automatically adds the key values defined for the data file to their respective index files. If successful, the new data record becomes the current ISAM record for datno. In multi-user applications, AddVRecord() automatically causes a data record lock to be placed on the new record. Therefore, LockISAM(ctENABLE) and LockISAM(ctFREE) should be called before and after AddVRecord(). However, if you are using transaction processing, (single-user and client/server models only), you will usually enable and free locks during the Begin() and Commit() functions. As of c-tree Plus V8.14, c-tree sets the current ISAM position after a record is added such that the next or previous record can be read without having to re-read the record just added. Prior to V8.14, the current ISAM position was not set to a newly-added record and an INOT_ERR (101) error would result if you tried to read either the next of previous record. Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example COUNT invfil; struct invd {
LONG part_no; LONG on_hand; TEXT part_name[120]; } recbuf;
recbuf.part_name);
strlen(recbuf.part_name)) || LockISAM(ctFREE)) printf("\nAddVRecord error %d in file %d",isam_err, isam_fil);
See also “ISAM Functions” of the c-tree Plus Programmer’s Reference Guide discusses how the relationship among the data files and their corresponding index files is specified. Begin(), Commit(), LockCtData(), LockISAM(), SetOperationState(), Commit(), LockISAM() |
|||||||||||||||||||||||||||||||||||||||