TOracleDataset.QueryRecord works incorrectly in case if you set up your Session.Preferences.MaxStringFieldSize in non 0 value and simultaneously TrimStringFields to True. In case if field value is nothing but the spaces the error is generated 'Unexpected datatype' because the buffer in that case is not assigned but the field value actually is not null.