In case you have not found the problem yet, it's here:

var* row = dataAppendRow (handle, cols);

A var is 8 bytes, but the elements of a database record, except the first, have a size of 4 bytes.