C
crystal_bobo
Unregistered / Unconfirmed
GUEST, unregistred user!
我用Table做一个数据的浏览的时候,在界面放了几个Button,第一个Button作为Edit可以设置正常,但是剩下的几个Button例如做Insert的ONClick时就显示这个错误:Cannot find implementation of method insertButtonClick
还有其他的一些Button就直接显示Could not find source location add method appendButtonClick ,'END.'or INITIANLIZATION not found in unit source.
我的窗口的代码目前是这样:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, StdCtrls, Buttons, ExtCtrls, DBCtrls, Grids, DBGrids;
type
TForm1 = class(TForm)
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
BitBtn1: TBitBtn;
editButton: TButton;
insertButton: TButton;
appendButton: TButton;
insertRecButton: TButton;
appendRecButton: TButton;
deleteButton: TButton;
Table1: TTable;
procedure editButtonClick(Sender: TObject);
procedure insertButtonClick(Sender: TObject);
procedure insertButtonClick(Sender: TObject);
procedure insertButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.editButtonClick(Sender: TObject);
begin
try
table1.edit;
table1.FieldByName ('ename').AsString:='Tom';
table1.Post;
except
table1.Cancel;
showmessage('Operation failed');
exit;
end;
end;
而且运行会显示这种错误:Could not complie used unit 'Unit .pas'
还有其他的一些Button就直接显示Could not find source location add method appendButtonClick ,'END.'or INITIANLIZATION not found in unit source.
我的窗口的代码目前是这样:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, StdCtrls, Buttons, ExtCtrls, DBCtrls, Grids, DBGrids;
type
TForm1 = class(TForm)
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
BitBtn1: TBitBtn;
editButton: TButton;
insertButton: TButton;
appendButton: TButton;
insertRecButton: TButton;
appendRecButton: TButton;
deleteButton: TButton;
Table1: TTable;
procedure editButtonClick(Sender: TObject);
procedure insertButtonClick(Sender: TObject);
procedure insertButtonClick(Sender: TObject);
procedure insertButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.editButtonClick(Sender: TObject);
begin
try
table1.edit;
table1.FieldByName ('ename').AsString:='Tom';
table1.Post;
except
table1.Cancel;
showmessage('Operation failed');
exit;
end;
end;
而且运行会显示这种错误:Could not complie used unit 'Unit .pas'