OdbcCommandBuilder generates special parameters for columns who allow NULL. However these are named the same as the columns which will result in type errors when binding the parameters.
It looks like the first parameter (named nullParam) created in CreateOptWhereClause needs always to be created with sourcecolumn being empty. If I do so no errors occur anymore and the query is ok.
As of why this works I guess this has to do with the way parameters are looked up in the parameter collection.