不给高分不行了,一个初学者竟然受到如此打击,在这里也发了不少帖子了,试过好多朋友的方法,都没解决,现详细说明.请大家帮帮忙.用database 的Form Wizard做一个简单的访问数据库(Delphi 6 自带的animals.dbf)的程序,出了数据库选择,其它都是默认选项,为什么F9后就出错?以下是拷贝来的源程序:
program Project1;uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};{$R *.res}begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}end.
 
unit Unit2;interfaceuses
  Windows, Messages, Classes, SysUtils, Graphics, Controls, StdCtrls, Forms,
  Dialogs, DBCtrls, DB, DBTables, Mask, ExtCtrls;type
  TForm2 = class(TForm)
    Table1NAME: TStringField;
    Table1SIZE: TSmallintField;
    Table1WEIGHT: TSmallintField;
    Table1AREA: TStringField;
    Table1BMP: TBlobField;
    ScrollBox: TScrollBox;
    Label1: TLabel;
    EditNAME: TDBEdit;
    Label2: TLabel;
    EditSIZE: TDBEdit;
    Label3: TLabel;
    EditWEIGHT: TDBEdit;
    Label4: TLabel;
    EditAREA: TDBEdit;
    Label5: TLabel;
    EditBMP: TDBEdit;
    DBNavigator: TDBNavigator;
    Panel1: TPanel;
    DataSource1: TDataSource;
    Panel2: TPanel;
    Table1: TTable;
    procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;var
  Form2: TForm2;implementation{$R *.DFM}procedure TForm2.FormCreate(Sender: TObject);
begin
  Table1.Open;
end;end.以下是出错提示:
[Fatal Error] Project1.dpr(6): Internal error: URW2160以下是过一段时间再F9的出错对话框:
Access violation at address 00ae3d32 in module'dcc60.dll'.Read of address FFFFFFFF之后退出Delphi时还说Delphi 32执行了非法操作.project.dpr被Readonly 之类.

解决方案 »

  1.   

    可能是你的 ODBC 或者 Delphi 6 出现了错误,删除再重装 delphi 或许能解决,不行的话就重装系统。
      

  2.   

    After my running successfully, I consider that there is no error in your source code. You should analysis and find out other reasons in your environment.
      

  3.   

    建議你先用delphi自帶的數據庫做程序.
      

  4.   

    将你的所有源代码复制出来,新建一个工程在放进去试一试,应该是 DELPHI 自身的问题。因为[Fatal Error] Project1.dpr(6): Internal error: URW2160,这时内置错误。
      

  5.   

    装上DELPHI的SERVICE 2再试试,不行再装系统
      

  6.   

    是Delphi6的环境或者操作系统的问题,你的问题不带有普遍性,别人很难给你意见,重新买一个Delphi6装上,不行的话,把Windows也重装试试。
      

  7.   

    正在找SERVICE 2
    希望多看到一些意见
      

  8.   

    你在设计状态下,将Table1的active属性设为true,如果出错,咋们再讨论!
      

  9.   

    program Project1;uses
      Forms,
      Unit1 in 'Unit1.pas' {Form1},
      Unit2 in 'Unit2.pas' {Form2};{$R *.res}begin
      Application.Initialize;
      Form2 : TForm2.Create(Application);
      Application.CreateForm(TForm1, Form1);
      //Application.CreateForm(TForm2, Form2);
      Application.Run;
    end.
      

  10.   

    靠,还以为是什么大毛病。
    在菜单“Options”里把有数据表的窗体设为
    第一个生成
      

  11.   

    to BoningSword:
      不是这样的,我试过,正常情况下,没有问题。
    to ihihonline:
      有点搞笑,
      //Application.CreateForm(TForm2, Form2);
      象这样,可以解决所有问题!
      

  12.   

    agree to  xb_luotuo(luotuo)
      

  13.   

    重启delphi或新建工程,然后编译看是否有错
      

  14.   

    不要用F9之类的操作,必须遵循"先编译,在运行调试"的步骤
    至于为什么,我也不清楚!
    呵呵,我开始用delphi一F9都是死机,出错算便宜你了!