Invalid Variant Type conversion error

I am getting this error randomly when adding new rows to the detail
table of a master detail set.  I have no clue what is wrong.  I have
changed anywhere I used ".value" to ".AsString" or whatever the
appropriate "AsXxxxx" would be.  I don't get the error until I try to
post the updates.  I am using cached updates.  The database is a Sybase
SqlAnywhere 6.0.4.  I am terrible at debugging, any help would be most
appreciated.  This error just started occurring out of the blue, I
haven't made any change that would cause this as far as I know.  Could
it be a problem with the database?  Thanks.