窗体关闭时出现 project ***.exe raised exception class exception with message 'prdupl'?

bluedoo 2009-08-31 04:57:17
如题,初来乍到,请各位大侠帮忙
...全文
180 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluedoo 2009-09-01
  • 打赏
  • 举报
回复
以前做的类似的窗口都没问题,现在这个把上面的fastreport控件删了也没问题,是不是fastreport控件出问题了,但是我重装了好几遍了
bluedoo 2009-09-01
  • 打赏
  • 举报
回复
unit kf_ck;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, SUIForm, cxStyles, cxCustomData, cxGraphics, cxFilter,
cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGrid, StdCtrls, RzCmboBx, SUIButton, RzLabel, ADODB,
dateutils, Mask, RzEdit, cxCurrencyEdit, frxClass, frxDBSet;

type
Tfrm_kf_ck = class(TForm)
suiForm1: TsuiForm;
cxGrid1DBTableView1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
RzComboBox1: TRzComboBox;
RzComboBox2: TRzComboBox;
RzLabel1: TRzLabel;
RzLabel2: TRzLabel;
suiButton1: TsuiButton;
suiButton2: TsuiButton;
suiButton3: TsuiButton;
suiButton4: TsuiButton;
suiButton5: TsuiButton;
ADOQuery_ck: TADOQuery;
ADOQuery_temp: TADOQuery;
ADOConnection_kf: TADOConnection;
DataSource_ck: TDataSource;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
cxStyleRepository2: TcxStyleRepository;
cxStyle2: TcxStyle;
cxStyleRepository3: TcxStyleRepository;
cxStyle3: TcxStyle;
RzLabel3: TRzLabel;
RzLabel4: TRzLabel;
RzLabel5: TRzLabel;
RzEdit1: TRzEdit;
RzEdit2: TRzEdit;
RzEdit3: TRzEdit;
suiButton6: TsuiButton;
cxGrid1DBTableView1F_CKRQ: TcxGridDBColumn;
cxGrid1DBTableView1F_CKDH: TcxGridDBColumn;
cxGrid1DBTableView1F_HTBH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPBH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPSH: TcxGridDBColumn;
cxGrid1DBTableView1F_TLPC: TcxGridDBColumn;
cxGrid1DBTableView1F_CPDJ: TcxGridDBColumn;
cxGrid1DBTableView1F_CPJC: TcxGridDBColumn;
cxGrid1DBTableView1F_CPPH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPFL: TcxGridDBColumn;
cxGrid1DBTableView1F_DWDM: TcxGridDBColumn;
cxGrid1DBTableView1F_DW: TcxGridDBColumn;
cxGrid1DBTableView1F_FPBH: TcxGridDBColumn;
cxGrid1DBTableView1F_JTBH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPJG: TcxGridDBColumn;
cxGrid1DBTableView1F_FH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPKW: TcxGridDBColumn;
cxGrid1DBTableView1F_XH: TcxGridDBColumn;
cxGrid1DBTableView1F_BH: TcxGridDBColumn;
cxGrid1DBTableView1F_TZ: TcxGridDBColumn;
RzDateTimeEdit1: TRzDateTimeEdit;
RzLabel6: TRzLabel;
RzEdit4: TRzEdit;
RzEdit5: TRzEdit;
RzEdit6: TRzEdit;
cxStyleRepository4: TcxStyleRepository;
cxStyle4: TcxStyle;
suiButton7: TsuiButton;
suiButton8: TsuiButton;
RzEdit7: TRzEdit;
RzLabel7: TRzLabel;
ADOQuery1: TADOQuery;
frxDBDataset1: TfrxDBDataset;
frxReport1: TfrxReport;
procedure FormCreate(Sender: TObject);
procedure suiButton1Click(Sender: TObject);
procedure suiButton3Click(Sender: TObject);
procedure suiButton6Click(Sender: TObject);
procedure suiButton4Click(Sender: TObject);
procedure suiButton2Click(Sender: TObject);
procedure suiButton5Click(Sender: TObject);
procedure suiButton7Click(Sender: TObject);
procedure suiButton8Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;

procedure MainFormset(a_Width,a_Height,a_Left,a_Top:integer);

var
frm_kf_ck: Tfrm_kf_ck;

implementation

uses MDI_kf_ck_add,MDI_kf_ck;

{$R *.dfm}
//***********************窗体设置函数*********************************************
procedure MainFormset(a_Width,a_Height,a_Left,a_Top:integer);
begin
application.MainForm.Width:=a_Width;
application.MainForm.Height:=a_Height;
application.MainForm.Left:=a_Left;
application.MainForm.Top:=a_Top;
end;

//***********************窗体初始化***********************************************
procedure Tfrm_kf_ck.FormCreate(Sender: TObject);
begin
MainFormset(1024,740,0,0);
Application.Title:='库房出库';
RzComboBox1.Text:=IntToStr(YearOf(Now));
RzComboBox2.Text:=IntToStr(MonthOf(Now));
if length(RzComboBox2.Text)=1 then
begin
RzComboBox2.Text:='0'+RzComboBox2.Text;
end;
with ADOQuery_ck do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text);
Open;
end;
RzEdit5.Text:=IntToStr(ADOQuery_ck.RecordCount);
end;

//********************** 退出按钮点击事件 ****************************************
procedure Tfrm_kf_ck.suiButton1Click(Sender: TObject);
begin
Application.Terminate; Exit;
//frm_kf_ck.Close;
//PostMessage(handle,WM_CLOSE,0,0);
end;

//********************** 添加按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton3Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_kf_ck_add, frm_kf_ck_add);
end;

//********************** 筛选按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton6Click(Sender: TObject);
begin
with ADOQuery_ck do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text
+' where f_ckdh like ''%'+RzEdit1.Text+'%'''
+' and f_cpbh like ''%'+RzEdit2.Text+'%'''
+' and f_cpsh like ''%'+RzEdit3.Text+'%''');
if RzDateTimeEdit1.Text<>'' then
SQL.Add(' and f_ckrq='''+RzDateTimeEdit1.Text+'''');
Open;
end;
RzEdit5.Text:=IntToStr(ADOQuery_ck.RecordCount);
end;

//********************** 编辑按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton4Click(Sender: TObject);
begin
// ADOQuery_ck.Edit;
end;

//********************** 确定按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton2Click(Sender: TObject);
begin
with ADOQuery_ck do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text);
Open;
end;
RzEdit5.Text:=IntToStr(ADOQuery_ck.RecordCount);
end;

//********************** 删除按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton5Click(Sender: TObject);
begin
// ADOQuery_ck.Delete;
end;

//********************** 读入按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton7Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_kf_ck_dao, frm_kf_ck_dao);
end;

//********************** 打印按钮事件 ********************************************
procedure Tfrm_kf_ck.suiButton8Click(Sender: TObject);
begin
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text
+' where f_ckdh='''+RzEdit7.Text+'''');
Open;
end;
frxReport1.Clear;
frxReport1.LoadFromFile('D:\smii\SMI_XS\deploy\CKMD.fr3');
frxReport1.PrepareReport;
frxReport1.ShowPreparedReport;
end;

procedure Tfrm_kf_ck.FormClose(Sender: TObject; var Action: TCloseAction);
begin
frxReport1.Clear;
Action:=cafree;

end;

end.
de410 2009-08-31
  • 打赏
  • 举报
回复
你把这个单元的代码全部贴出来~~这样看不出来~~
bluedoo 2009-08-31
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 winstonbonaparte 的回复:]
这些代码是不会出错的。你看是不是哪个对象或是线程没有释放掉
[/Quote]
这个怎么看的 还有这么给分啊这里
winstonbonaparte 2009-08-31
  • 打赏
  • 举报
回复
这些代码是不会出错的。你看是不是哪个对象或是线程没有释放掉
bluedoo 2009-08-31
  • 打赏
  • 举报
回复
fastreport3.0 重装了好几次都不行
bluedoo 2009-08-31
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 zxf_feng 的回复:]
看看是不是创建的对像没有释放
[/Quote]
procedure Tfrm_kf_ck.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=cafree;

end;
这样子不知道合适么,以前都不出问题的
bluedoo 2009-08-31
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 lovelymelon 的回复:]
把关闭代码发上来看看
[/Quote]
procedure Tfrm_kf_ck.suiButton1Click(Sender: TObject);
begin
Application.Terminate; Exit;
end;
以前做的程序这样子都没问题的
阿三 2009-08-31
  • 打赏
  • 举报
回复
看看是不是创建的对像没有释放
winstonbonaparte 2009-08-31
  • 打赏
  • 举报
回复
你关闭的时候进行了什么操作?发上来看看
lovelymelon 2009-08-31
  • 打赏
  • 举报
回复
把关闭代码发上来看看

5,392

社区成员

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

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