在DBLookupComboboxEh1中显示
select  a.FId as 编号,case a.FId when  ''00'' then a.FName else '' ''+a.FName end as 名称,a.FName   
from  MyOrgan我想在其中添加一个临时记录  -1  请选择    不是真的保存到数据库,LockType:=ltBatchOptimistic;DBLookupComboboxEh1.ListSource.DataSet.Append;
DBLookupComboboxEh1.ListSource.DataSet.FieldByName('编号').AsString:='-1';
DBLookupComboboxEh1.ListSource.DataSet.FieldByName('名称').AsString:='请选择';提示 field '名称' canot be modified
这要怎么解决呢?  我只想临时显示-1  请选择 
或者有没有其他多列的非感知Combobox呢?

解决方案 »

  1.   

    ado没那么智能的吧
    你都使用bookup了,应该是它而不是case when来实现显示转换了
      

  2.   

    智能?为什么DBLookupComboboxEh1.ListSource.DataSet.FieldByName('名称').AsString:='请选择';这句出错了 
    错误提示  field '名称' canot be modified
      

  3.   

    你这个好像并没有多表联合哦,或许是你字段,或记录集或DbGrid的FIELD里有ReadOnly=true类的东东吧,,
    重新添加下静态字段试试
      

  4.   

    名称是case when处理后的字段,是只读不可编辑的
    像sum(),avg() ... 等等,結果也是只读的不可编辑