ABS数据库的修改对应到相应窗体的edit里面 ( 积分: 50 )

  • 主题发起人 主题发起人 buxiaolei
  • 开始时间 开始时间
B

buxiaolei

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大哥帮帮忙!我对应老是提示发现不了字段,源代码如下,那位朋友帮帮忙
begin
FrmAddCar:=TFrmAddCar.Create(nil);
FrmAddCar.Caption:='修改车辆';
for i:= 1 to DBAdvGrid1.RowCount -1 do
if DBAdvGrid1.RowSelect then
s:=DBAdvGrid1.Cells[0,i];
//ShowMessage(s);
with DMLBS.ABSQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('selecta.CarID ,a.CarType ,b.Name ,b.PhoneNum ,a.MainLine ,a.TruckState,a.ServersTyp);
SQL.Add('from Cars a,Drivers b where a.DriverID=b.ID and a.CarID='''+trim(s)+'''');
Open;
//DMLBS.ABSQuery1.ReadOnly:=True;
//Edit;
if DMLBS.ABSQuery1.IsEmpty then Exit;
while not DMLBS.ABSQuery1.Eof do
begin
FrmAddCar.edtCarID.Text:=fieldByName('CarID').AsString;
FrmAddCar.edtDriverName.Text:=FieldByName('Name').AsString;
FrmAddCar.edtCarPhone.Text:=FieldByName('PhoneNum').AsString;
FrmAddCar.edtCarType.Text:=FieldByName('CarType').AsString;
FrmAddCar.edtMainLIne.Text:=FieldByName('MainLine').AsString;
FrmAddCar.cbbTruckState.Text:=FieldByName('TruckState').AsString;
FieldByName('CarID').Value:=FrmAddCar.edtCarID.Text;
end;
FrmAddCar.AdvGlowButton1.Caption:='修改并保存';
FrmAddCar.Show;
// FrmAddCar.AdvGlowButton1Click(act3);
end;
运行结果是 ABSQuery1 not find Field "CarID" 请看到的朋友帮忙
 
后退
顶部