全部复制即可,单位文件:
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, StdCtrls, QRCtrls, QuickRpt, ExtCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    ADOTable1: TADOTable;
    QuickRep1: TQuickRep;
    ADOConnection1: TADOConnection;
    QRBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRBand2: TQRBand;
    QRDBText1: TQRDBText;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
  with ADOTable1 do
  begin
    Edit;
    FieldByName('PassWordFld').AsString := 'aaa';
    Post;
  end;    // with
end;procedure TForm1.FormCreate(Sender: TObject);
begin
  Quickrep1.PreviewModal;
end;end.

解决方案 »

  1.   

    窗体文件:
    object Form1: TForm1
      Left = 238
      Top = 106
      Width = 696
      Height = 480
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      Scaled = False
      OnCreate = FormCreate
      PixelsPerInch = 96
      TextHeight = 13
      object Button1: TButton
        Left = 144
        Top = 56
        Width = 75
        Height = 25
        Caption = 'Button1'
        TabOrder = 0
        OnClick = Button1Click
      end
      object QuickRep1: TQuickRep
        Left = 0
        Top = 0
        Width = 794
        Height = 1123
        Frame.Color = clBlack
        Frame.DrawTop = False
        Frame.DrawBottom = False
        Frame.DrawLeft = False
        Frame.DrawRight = False
        DataSet = ADOTable1
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Arial'
        Font.Style = []
        Functions.Strings = (
          'PAGENUMBER'
          'COLUMNNUMBER'
          'REPORTTITLE')
        Functions.DATA = (
          '0'
          '0'
          '''''')
        Options = [FirstPageHeader, LastPageFooter]
        Page.Columns = 1
        Page.Orientation = poPortrait
        Page.PaperSize = A4
        Page.Values = (
          100
          2970
          100
          2100
          100
          100
          0)
        PrinterSettings.Copies = 1
        PrinterSettings.Duplex = False
        PrinterSettings.FirstPage = 0
        PrinterSettings.LastPage = 0
        PrinterSettings.OutputBin = Auto
        PrintIfEmpty = True
        SnapToGrid = True
        Units = MM
        Zoom = 100
        object QRBand1: TQRBand
          Left = 38
          Top = 38
          Width = 718
          Height = 40
          Frame.Color = clBlack
          Frame.DrawTop = False
          Frame.DrawBottom = False
          Frame.DrawLeft = False
          Frame.DrawRight = False
          AlignToBottom = False
          Color = clWhite
          ForceNewColumn = False
          ForceNewPage = False
          Size.Values = (
            105.833333333333
            1899.70833333333)
          BandType = rbColumnHeader
          object QRLabel1: TQRLabel
            Left = 16
            Top = 8
            Width = 31
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              42.3333333333333
              21.1666666666667
              82.0208333333333)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Caption = 'Code'
            Color = clWhite
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
        end
        object QRBand2: TQRBand
          Left = 38
          Top = 78
          Width = 718
          Height = 40
          Frame.Color = clBlack
          Frame.DrawTop = False
          Frame.DrawBottom = False
          Frame.DrawLeft = False
          Frame.DrawRight = False
          AlignToBottom = False
          Color = clWhite
          ForceNewColumn = False
          ForceNewPage = False
          Size.Values = (
            105.833333333333
            1899.70833333333)
          BandType = rbDetail
          object QRDBText1: TQRDBText
            Left = 16
            Top = 8
            Width = 29
            Height = 17
            Frame.Color = clBlack
            Frame.DrawTop = False
            Frame.DrawBottom = False
            Frame.DrawLeft = False
            Frame.DrawRight = False
            Size.Values = (
              44.9791666666667
              42.3333333333333
              21.1666666666667
              76.7291666666667)
            Alignment = taLeftJustify
            AlignToBand = False
            AutoSize = True
            AutoStretch = False
            Color = clWhite
            DataSet = ADOTable1
            DataField = 'code'
            Transparent = False
            WordWrap = True
            FontSize = 10
          end
        end
      end
      object ADOTable1: TADOTable
        Active = True
        Connection = ADOConnection1
        CursorType = ctStatic
        TableName = 'Code'
        Left = 32
        Top = 65528
      end
      object ADOConnection1: TADOConnection
        Connected = True
        ConnectionString =
          'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\Hy_Dqx\Data\DQX.' +
          'MDB;Persist Security Info=False'
        LoginPrompt = False
        Mode = cmShareDenyNone
        Provider = 'Microsoft.Jet.OLEDB.4.0'
        Left = 120
        Top = 65528
      end
    end
      

  2.   

    ADOConnect1.ConnectionString处你要改成自己的数据库,ADOTable1.TableName处也一样
      

  3.   

    不知道你的Button1是做什么用的呀?