帮助中 TCustomADODataSet is the base class for datasets that access their data using ActiveX Data Objects (ADO). TCustomADODataSet descendants include TADODataSet, TADOTable, TADOQuery, and TADOStoredProc. Developers who create custom dataset components that use ADO derive them from CustomADODataSet.fieldbyname是TDataSet的属性 DataSet-CustomADODataSet-ADOQuery,因为ADOQuery继承了父辈,所以adoquery.fieldbyname
1. 前面有错. 2. 你用的是Delphi7
把他们都改成公用的试试,或者是赋值类型不一致,比如 i : integer ; obj.Name为string 的,i :=obj.是出不来Name的。
比如
//var cname:string;
cname := adoquery1.
//这个时候FieldByName不会出来,因为FieldByName的结果是一个TField类型,而前面的字符串类型使它的智能感知把这个给过滤掉了。不过你写就是了,不会出错的,呵呵
TCustomADODataSet is the base class for datasets that access their data using ActiveX Data Objects (ADO). TCustomADODataSet descendants include TADODataSet, TADOTable, TADOQuery, and TADOStoredProc. Developers who create custom dataset components that use ADO derive them from CustomADODataSet.fieldbyname是TDataSet的属性
DataSet-CustomADODataSet-ADOQuery,因为ADOQuery继承了父辈,所以adoquery.fieldbyname
2. 你用的是Delphi7
obj.Name为string 的,i :=obj.是出不来Name的。