2. 非也,非也!一定要将数据库也连着跑。
3. 一般的DELPHI数据库应用程序的发布,如果是用当地数据库,并且是用BDE的,那么有专门的安装程序将EXE和BDE一起分发;如果是用的非当地数据库(如C/S结构的),那么一般在客户端还要安装数据库的客户端程序,如IBCLIENT;如果是用ODBC,那么要分发数据库的ODBC;如果用ADO,那么目的机器上一定要安装过OLE DB(不过我没有试过,姑妄论之)。

解决方案 »

  1.   

    1、
    const
      b = 4;  {Total number of buttons to create}var
      ButtonArray : Array[0..b-1] of TButton; {Set up an array of buttons}
      MessageBox: TLabel;                     {...and a label!}procedure TForm1.FormCreate(Sender: TObject);
      var
        loop : integer;
    begin
      ClientWidth:=(b*60)+10;               {Size the form to fit all the}
      ClientHeight:=65;                     {components in.}  MessageBox:=TLabel.Create(Self);      {Create a label...}
      MessageBox.Parent:=Self;
      MessageBox.Align:=alTop;              {...set up it's properties...}
      MessageBox.Alignment:=taCenter;
      MessageBox.Caption:='Press a Button';  for loop:= 0 to b-1 do                {Now create all the buttons}
          begin
            ButtonArray[loop]:=TButton.Create(Self);
            with ButtonArray[loop] do       {Note the use of the with command.}
              begin                         {This lets you leave out the first}
                Parent  :=self;             {bit of the description and}
                Caption :=IntToStr(loop);   {(I think) makes the code easier}
                Width   :=50;               {to read.}
                Height  :=25;
                Top     :=30;
                Left    :=(loop*60)+10;
                Tag     :=loop;      {Used to tell which button is pressed}
                OnClick :=ButtonClick; {The important bit!}
              end;
          end;
    end;procedure TForm1.ButtonClick(Sender: TObject);
      var
        t : Integer;
    begin
      t:=(Sender as TButton).Tag;{Get the button number}
      MessageBox.Caption:='You pressed Button '+IntToStr(t);
    end;
      

  2.   

    非常感谢coldljy(凤舞N天),一试就成功了,我感动得真是痛哭流涕;再次感谢!