一个让我困惑的问题

barney 2002-03-09 12:33:12
我编写了一个小软件,有ADOTable等控件,连接了一条mdb文件。但在本机上运行很正常,在另一台机上就会出错,错误如下“Excption EStackOverflow in module project1.exe at oooAFoc9 Stack overflow”我不知道为什么?希望有人答我拉!

代码如下:

着是unit1:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Grids, DBGrids, DBCtrls, DB, Mask, ADODB;

type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
ADOTable1: TADOTable;
ADOTable1DSDesigner: TWideStringField;
ADOTable1DSDesigner2: TWideStringField;
ADOTable1DSDesigner3: TBCDField;
ADOTable1DSDesigner4: TBCDField;
Label1: TLabel;
DBEdit1: TDBEdit;
DataSource1: TDataSource;
Label2: TLabel;
DBEdit2: TDBEdit;
Label3: TLabel;
DBEdit3: TDBEdit;
Label4: TLabel;
DBComboBox1: TDBComboBox;
DBGrid1: TDBGrid;
StatusBar1: TStatusBar;
GroupBox1: TGroupBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
GroupBox2: TGroupBox;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Button6: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
ADOTable1.Insert ;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if ADOTable1.State = dsEdit then
ADOTable1.Post ;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
if not ADOTable1.Eof then
begin
if Application.MessageBox('确认删除这笔数据?' ,'注意' MB_YESNO+MB_ICONQUESTION) = IDYES then
ADOTable1.Delete ;
end;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
ADOTable1.Cancel ;
end;

procedure TForm1.Button5Click(Sender: TObject);
var
temp : integer ;
total : integer ;
begin
temp := 0 ;
total := 0 ;
ADOTable1.First ;
while not ADOTable1.Eof do
begin
temp := temp + ADOTable1.fields[2].AsInteger ;
total := total + ADOTable1.fields[3].AsInteger ;
ADOTable1.Next ;
end;
Label7.Caption := IntToStr(temp) ;
Label8.Caption := IntToStr(total) ;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
Form2.Show ;

end;

end.

这是unit2:

unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls, DB, ADODB;

type
TForm2 = class(TForm)
ADOTable1: TADOTable;
QuickRep1: TQuickRep;
QRBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRShape1: TQRShape;
DetailBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
QRSysData1: TQRSysData;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormShow(Sender: TObject);
begin
QuickRep1.Preview ;
end;

end.

希望有人回答我拉!
...全文
34 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
barney 2002-03-09
  • 打赏
  • 举报
回复
不可能啊,我有另一台机同样是装了delphi6啊,但一样都是这样出错。声明:我是用D版的。^_^
barney 2002-03-09
  • 打赏
  • 举报
回复
但还没有学会怎样配置数据引擎啊,我在本机上真的很正常啊!
barney 2002-03-09
  • 打赏
  • 举报
回复
终于解决了,哈哈哈~~~~~~~~~~~~`
lovedata 2002-03-09
  • 打赏
  • 举报
回复
这个错误应当是表明操作系统在管理栈时出错,一般是很少见的,应用程序对战备操作系统根据需要扩大,但可能在内寻较低的时候发生.
barney 2002-03-09
  • 打赏
  • 举报
回复
我怎么给不了分啊?5555~~~~~~~~~~~
barney 2002-03-09
  • 打赏
  • 举报
回复
如果要源代码,联系我拉,E_mail:hvrstudio@163.com 谢谢各位拉!
mayunshui 2002-03-09
  • 打赏
  • 举报
回复
有没有配置数据库引擎
王集鹄 2002-03-09
  • 打赏
  • 举报
回复
如果你的ADOConnection1在设计期间就是打开的就会出现这类情况

ADOConnection1需要动态连接

5,930

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧