用ado连接acess数据库,其中有一个字段类型为备注,在DBGird中显示不出其中的内容,显示为(MEMO),请问怎么显示内容

解决方案 »

  1.   

    在dbgrid的ondrawcolumncell事件里,写如下代码:
    我的 content字段是memo字段procedure TForm1.custDBGridDrawColumnCell(Sender: TObject;
      const Rect: TRect; DataCol: Integer; Column: TColumn;
      State: TGridDrawState);
    begin
      if(column.field = custdbgrid.DataSource.DataSet.FieldByName('content')) then
         begin
         custDBGrid.Canvas.FillRect(Rect);
         custDBGrid.Canvas.TextOut(Rect.Left,Rect.Top,column.field.AsString);
         end;
    end;
      

  2.   

    可是这种方法只能在DBGrid中显示,但是不能改动呀,还有别的方法么
      

  3.   

    在Table 的固定字段的gettext事件中写程序就行了
    text:=table.fieldbyname('字段名').asstring;
      

  4.   

    有没有不用第三方控件的方法在dbgrid的ondrawcolumncell事件里,写如下代码:
    我的 content字段是memo字段procedure TForm1.custDBGridDrawColumnCell(Sender: TObject;
      const Rect: TRect; DataCol: Integer; Column: TColumn;
      State: TGridDrawState);
    begin
      if(column.field = custdbgrid.DataSource.DataSet.FieldByName('content')) then
         begin
         custDBGrid.Canvas.FillRect(Rect);
         custDBGrid.Canvas.TextOut(Rect.Left,Rect.Top,column.field.AsString);
         end;
    end;
    不过好像也只有这个办法了,为什么不用第三方控件?:)