很简单的东西~我的程序有一个from和一个DataModule,在datemodule里我添加了一个BDE的Table,设置都很正常,自己写了一个简单函数如下
procedure TDataModule2.Load();
begin
Table1.First;
end;之后~在from里use段~我添加了datemodule这个单元的名字并调用了上边的函数
procedure TForm1.FormCreate(Sender: TObject);
begin
Unit2.DataModule2.Load;
end;可是运行的时候却给我个大红叉~~说内存什么什么有错如下
Project Project1.exe raised execption class EAccessViolation with message 'Accessviloation at address 00493490 in moduel 'Project1.exe'. Read of address 00000058'.Process stropped.苦思不得其解啊~~~忘各位帮忙~~~ >_<
procedure TDataModule2.Load();
begin
Table1.First;
end;之后~在from里use段~我添加了datemodule这个单元的名字并调用了上边的函数
procedure TForm1.FormCreate(Sender: TObject);
begin
Unit2.DataModule2.Load;
end;可是运行的时候却给我个大红叉~~说内存什么什么有错如下
Project Project1.exe raised execption class EAccessViolation with message 'Accessviloation at address 00493490 in moduel 'Project1.exe'. Read of address 00000058'.Process stropped.苦思不得其解啊~~~忘各位帮忙~~~ >_<
procedure Load();//要放在Public段
program Project1;uses
......{$R *.res}begin
Application.Initialize;
..... //确保创建DataModule在创建Form的前面。
Application.Run;
end.
begin
Load;
end;