不给高分不行了,一个初学者竟然受到如此打击,在这里也发了不少帖子了,试过好多朋友的方法,都没解决,现详细说明.请大家帮帮忙.用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 之类.
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 之类.
解决方案 »
- idtcpserver可以删除所在服务器的某个文件吗?
- [pascal 错误] logonunit.pas(1):程序有错,不能完成调和
- 如何让程序自己覆盖自己!并且在覆盖后再自动运行?
- 兄弟们,后天去做erp的公司复试!!给点意见
- dephi有何国外交流网站。
- 关于界面的问题,TOOLBAR,MENU 如何做的象WEB 的风格?在线给分...........
- 求救 VCLUnZip 解压问题~
- 帮我看看哪,我写的代码,哪里有错,d7+sqlserver2000
- 50分,怎样把'select id from b1 where id = '+dbedit1.text);的结果保存在一个变量a里面去
- dbgrideh数据导出的问题
- 请问在线程中怎么调用showmessage?
- Delphi中,可不可以在调用Windows自带的OUTLOOK时自动带上邮件内容,如附件等
希望多看到一些意见
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.
在菜单“Options”里把有数据表的窗体设为
第一个生成
不是这样的,我试过,正常情况下,没有问题。
to ihihonline:
有点搞笑,
//Application.CreateForm(TForm2, Form2);
象这样,可以解决所有问题!
至于为什么,我也不清楚!
呵呵,我开始用delphi一F9都是死机,出错算便宜你了!