这样不行:
with adoquery2 do
begin
try
close;
sql.Clear;
sql.Add('select 类别,名称,规格,品牌,车型,通用车型 from 进货');
open;
label37.Caption:=inttostr(recordcount);
except
label37.Caption:='0';
end;
end;
但这样却行:
with adoquery2 do
begin
try
close;
sql.Clear;
sql.Add('select * from 进货');
open;
label37.Caption:=inttostr(recordcount);
except
label37.Caption:='0';
end;
end;
为什么啊???
真郁闷~!
with adoquery2 do
begin
try
close;
sql.Clear;
sql.Add('select 类别,名称,规格,品牌,车型,通用车型 from 进货');
open;
label37.Caption:=inttostr(recordcount);
except
label37.Caption:='0';
end;
end;
但这样却行:
with adoquery2 do
begin
try
close;
sql.Clear;
sql.Add('select * from 进货');
open;
label37.Caption:=inttostr(recordcount);
except
label37.Caption:='0';
end;
end;
为什么啊???
真郁闷~!
========你的字段名不正确吧
你这样试试吧,也许 类别 在你的数据库中被当成了保留字/关键字sql.Add('select [类别],名称,规格,品牌,车型,通用车型 from 进货');即:把类别用英文中括与括起来。