Article View: cn.bbs.comp.lang.delphi
Article #4841delphi��һ�����⣬�����ƺ���һ��bug
From: ̫������
Date: Thu, 10 Jul 2003 13:38
Date: Thu, 10 Jul 2003 13:38
122 lines
3756 bytes
3756 bytes
�Ҹ���һ��һ�δ��룬��ҿ��Բ���һ�¡������������ģ�
���ڴ����Ϸ���opendialog��table��button����ؼ�������
�ڴ��ļ�֮�ͽ���һ����ʱ�?���������µĴ��룺
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBTables;
type
TForm1 = class(TForm)
Table1: TTable;
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
begin
if table1.Exists then
table1.deletetable
else
begin
with table1 do
begin
with fielddefs.AddFieldDef do
begin
datatype:=ftstring;
size:=20;
name:='�Ұ���';
end;
with fielddefs.AddFieldDef do
begin
datatype:=ftstring;
size:=20;
name:='������';
end;
createtable;
end;
end;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
with table1 do
if exists then deletetable;
end;
end.
��������ʱ�?��������ĵ�ǰĿ¼�£�������opendialog��Ŀ¼
����ȥ�ˣ�ͬ�������Ĵ���Ҳ��һ��Ľ��
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBTables;
type
TForm1 = class(TForm)
Table1: TTable;
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
flag:bool;
begin
if opendialog1.Execute then
begin
flag:=true;
end;
if flag=true then
begin
if table1.Exists then
table1.deletetable
else
begin
with table1 do
begin
with fielddefs.AddFieldDef do
begin
datatype:=ftstring;
size:=20;
name:='�Ұ���';
end;
with fielddefs.AddFieldDef do
begin
datatype:=ftstring;
size:=20;
name:='������';
end;
createtable;
end;
end;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
with table1 do
if exists then deletetable;
end;
end.
��֪������㲻����delphi��һ��bug�ˣ�
--
[m[1;32m�� ��Դ:�����Ļ����� bbs.cqupt.edu.cn��[FROM: 172.16.33.189][m
Technical Details
Message-ID:
<47DDVN$NeS@bbs.cqupt.edu.cn>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!news.bylinux.net!news.zixia.net!news2.uestc.edu.cn!CQUPTShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: f7a78,b26a829b8028c349,start X-Google-Attributes: gidf7a78,public X-Google-ArrivalTime: 2003-07-10 06:52:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!news.bylinux.net!news.zixia.net!news2.uestc.edu.cn!CQUPT From: wty.bbs@bbs.cqupt.edu.cn (̫������) Newsgroups: cn.bbs.comp.lang.delphi Subject: delphi��һ�����⣬�����ƺ���һ��bug Date: 10 Jul 2003 13:38:48 GMT Organization: ���Ļ����� Message-ID: <47DDVN$NeS@bbs.cqupt.edu.cn> X-Filename: Delphi/M.1057843943.A Lines: 122