那位高手能帮帮我,以下方法如何用?
ADOQuery1.GetFieldData

解决方案 »

  1.   

    Retrieves the current value of a field into a buffer.function GetFieldData(Field: TField; Buffer: Pointer): Boolean; override;
    DescriptionMost applications do not need to call GetFieldData. TField objects call this method to implement their GetData method.The Field or FieldNo parameter indicates the field whose data should be fetched. Field specifies the component itself, while FieldNo indicates its field number.Buffer is a memory buffer with sufficient space to accept the value of the field as it exists in the database (unformatted and untranslated). GetFieldData returns a value that indicates whether the data was successfully fetched.GetFieldData returns a boolean value indicating whether the operation was successful.
    ---------------------------------------------------------------------------------
    自己看吧。
      

  2.   

    取得数据集中当前记录的第FieldNo字段的值,保存到缓冲区Buffer中。例如:
    var
      Buffer: Pointer;
    begin
      GetMem(Buffer, MAXBYTE);
      ADOQuery1.GetFieldData(3, Buffer);  //取得第3字段的值
      ShowMessage(PChar(Buffer));   //假设值为字符串类型
      FreeMem(Buffer);
    end;一般不需要直接使用这个函数,相应的可以使用TField的一些属性,如:
    AsString、AsInteger、AsVariant、Value等。—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————