Initializes a record.
Sub InitRec(ByVal hTable As Long, ByVal hRec As Long)
The handle to the table.
The handle to the record that is to be initialized.
CF1.OpenTable hTable, .Text1(cf.TableNoCreate).Text
hRecord = CF1.AllocRec(hTable)
CF1.InitRec hTable, hRecord
CF1.InsertRec hTable, hRecord
If CF1.RecCount(hTable) = 3 Then
logWr "Initrec OK"
logWr "Initrec failed"
InitRec assigns default values to each field in the record buffer. The values correspond to those that were defined when the table was created in C/SIDE. Fields for which no values were defined are assigned zero values.
After this operation has been performed, you are free to change the values in any or all of the fields before calling InsertRec to enter the record in the table. Ensure that the field(s) which make up the primary key contain values that make the contents of the total primary key unique. If the contents of the total primary key are not unique, the database manager will reject the record.