can JetSetColumns be used to replace JET_coltypLongBinary values?

191 views Asked by At

if I call JetSetColumn() to replace the contents of a JET_coltypLongBinary value the operation works as I expect - the value is replaced

however, if I call JetSetColumns() the value is not replaced - instead the value remains at its old value. Oddly other columns (not long ones) are updated as expected. No error is returned.

The same behavior happens for JET_coltypLongText - making me wonder if JetSetColumns() cannot be used on long values?

tips?

1

There are 1 answers

2
Laurion Burchall On BEST ANSWER

You probably aren't setting the itagSequence in the JET_SETCOLUMN structure. It is non-obvious 'feature' of the API.

"A common programming error when using ESENT is using an itagSequence of 0 when updating a column value. By default the JET_SETINFO and JET_SETCOLUMN structures are intialized with a itagSequence of 0. That works for inserts (which have to create a new instance of a record) but when updating a record the default behaviour will be to create a new instance of a column instead of updating the existing one. To overwrite an existing column you must set the itagSequence, even if the column is single-valued."

http://managedesent.codeplex.com/wikipage?title=MultiValueTutorial