J
jesse.zhou
Unregistered / Unconfirmed
GUEST, unregistred user!
我在成dbgrid中一欄輸入數據
dbgrid1.ONCOLEXIT如下:
if dbgrid1.Columns.Items.Title.Caption='商品編號' then <---- {這一行有誤}
if dbgrid1.DataSource.DataSet.FieldByName('igoodsno').Value<>'' then
begin
with adoquery2 do
begin
close;
parameters.Refresh;
parameters.ParamByName('ino').Value:=dbgrid1.DataSource.DataSet.FieldValues['igoodsno'];
prepared;
open;
end;
if adoquery2.RecordCount<>0 then
begin
adoquery1.Edit;
adoquery1.FieldByName('name').Value:=adoquery2.FieldValues['name'];
adoquery1.FieldByName('description').Value:=adoquery2.FieldValues['description'];
end;
end;
dbgrid1.ONCOLEXIT如下:
if dbgrid1.Columns.Items.Title.Caption='商品編號' then <---- {這一行有誤}
if dbgrid1.DataSource.DataSet.FieldByName('igoodsno').Value<>'' then
begin
with adoquery2 do
begin
close;
parameters.Refresh;
parameters.ParamByName('ino').Value:=dbgrid1.DataSource.DataSet.FieldValues['igoodsno'];
prepared;
open;
end;
if adoquery2.RecordCount<>0 then
begin
adoquery1.Edit;
adoquery1.FieldByName('name').Value:=adoquery2.FieldValues['name'];
adoquery1.FieldByName('description').Value:=adoquery2.FieldValues['description'];
end;
end;