本文主要是介绍为什么delphi中总是报错,说是加班天数 field cann't found。可是我明明已经赋新值啦!求高手指导,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
procedure TForm3.Button6Click(Sender: TObject);
var
sqlstr:string;
begin
sqlstr:='select recordno as 记录号,stuffno as 职工编号,startdate as 开始日期,enddate as 结束日期,days as 加班天数 from ExtraworkTable';
DM.ADOQuery14.Close;
DM.ADOQuery14.SQL.Clear;
DM.ADOQuery14.SQL.Add(SQLSTR);
DM.ADOQuery14.Open;
form8.DBGrid1.DataSource:=DM.DataSource14;
form8.DBEdit1.DataSource:=DM.DataSource14;
form8.DBEdit2.DataSource:=DM.DataSource14;
form8.DBEdit3.DataSource:=DM.DataSource14;
form8.DBEdit4.DataSource:=DM.DataSource14;
form8.DBEdit1.DataField:='职工编号';
form8.DBEdit2.DataField:='加班天数';
form8.DBEdit3.DataField:='开始日期';
form8.DBEdit4.DataField:='结束日期';
DM.ADOQuery14.Active:=true;
form8.Caption:='加班记录管理';
form8.Show;
end;
procedure TForm3.Button9Click(Sender: TObject);
var
sqlstr:string;
begin
sqlstr:='select recordno as 记录号,stuffno as 职工编号,startdate as 开始日期,enddate as 结束日期,days as 出差天数 from EvectionTable';
DM.ADOQuery14.Close;
DM.ADOQuery14.SQL.Clear;
DM.ADOQuery14.SQL.Add(sqlstr);
DM.ADOQuery14.Open;
form8.DBGrid1.DataSource:=DM.DataSource14;
form8.DBEdit1.DataSource:=DM.DataSource14;
form8.DBEdit2.DataSource:=DM.DataSource14;
form8.DBEdit3.DataSource:=DM.DataSource14;
form8.DBEdit4.DataSource:=DM.DataSource14;
form8.DBEdit1.DataField:='职工编号';
form8.DBEdit2.DataField:='出差天数';
form8.DBEdit3.DataField:='开始日期';
form8.DBEdit4.DataField:='结束日期';
DM.ADOQuery14.Active:=true;
form8.Label2.Caption:='出差天数:';
form8.Caption:='出差记录管理';
form8.Show;
end;
这篇关于为什么delphi中总是报错,说是加班天数 field cann't found。可是我明明已经赋新值啦!求高手指导的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!