L
lovewjm
Unregistered / Unconfirmed
GUEST, unregistred user!
我用如下方法,向clientdataset动态建立字段, clientdataet指向fquery.. procedure cds_AddPersistentCol(Fcds:Tclientdataset;Faspc:Tadostoredproc;Fquery:Tadoquery);vari:integer;field:Tstringfield;begin fcds.Close; for i := 0 to fquery.FieldCount-1 do begin Field := TStringField.Create(Fcds); Field.FieldKind := fkData; Field.FieldName:= fquery.fields.fields.FieldName; Field.Name:= fquery.fields.Fields.Name; Field.DataSet := Fcds; end;end;但运行时出现错误,:type mismatch for field "pc_no".expecting string, actual is widestring.. 就是字段类型不匹配 这问题怎么解决啊? 请各位高人指点,急..