代码如下:var
astr,s:string;
begin
astr:= 'select * from GoodsInfo';
with adoqurys do
begin
close;
sql.Clear;
sql.Add(astr);
open;
if RecordCount=0 then exit;
self.Bigclass.Text:=adoqurys.FieldByName('GoodsTezheng').AsString;//没有问题,但是,我再把此句复制如下,就出错
self.Bigclass.Text:=adoqurys.FieldByName('GoodsTezheng').AsString;//出错
self.edt_beizhu.Text:=adoqurys.FieldByName('a').AsString;//刚加的字段,也不行,
self.edt_beizhu.Text:=adoqurys.FieldByName('b').AsString;
end;
end;
提示 adoqurys 为发现字段'a',
想实现的功能: 就是查询GoodsInfo', 赋值到多个 编辑框中
astr,s:string;
begin
astr:= 'select * from GoodsInfo';
with adoqurys do
begin
close;
sql.Clear;
sql.Add(astr);
open;
if RecordCount=0 then exit;
self.Bigclass.Text:=adoqurys.FieldByName('GoodsTezheng').AsString;//没有问题,但是,我再把此句复制如下,就出错
self.Bigclass.Text:=adoqurys.FieldByName('GoodsTezheng').AsString;//出错
self.edt_beizhu.Text:=adoqurys.FieldByName('a').AsString;//刚加的字段,也不行,
self.edt_beizhu.Text:=adoqurys.FieldByName('b').AsString;
end;
end;
提示 adoqurys 为发现字段'a',
想实现的功能: 就是查询GoodsInfo', 赋值到多个 编辑框中
'select * from GoodsInfo'
修改数据库结构后会出错。这样写就好了:
'select GoodsTezheng, a, b from GoodsInfo'
可以双击adoqurys,点右键,把字段a、b添加进去