脸
脸谱
Unregistered / Unconfirmed
GUEST, unregistred user!
这是我写的一代码:
var str1,str2:string;
bb:boolean;
begin
if (not gcdj.IsEmpty) and (not cydwdm.IsEmpty) then //如果工程登记和来源单位表不为空
begin
str1:=gcdj.FieldByName('gcbh').asstring;//读取工程登记表中的工程编号字段等于str1
str2:=DBlookupcombobox3.Text ;//读取来源单位等于str2
bb:=sgdw.Locate('gcbh;sgdw',vararrayof([str1,str2]),[]);
if bb then
MessageDlg('已有该施工队伍!!', mtWarning, [mbOK], 0)
else begin
sgdw.Insert;
sgdw.FieldByName('sgdw').asstring:=str2;//来源单位填入施工单位表中的施工单位字段中
sgdw.Post;
sgdw.Refresh;
end;
end;
//这下面是我为了测试这个现在在施工单位中的工程编号的值
str1:=sgdw.fieldbyname('gcbh').AsString;
showmessage(str1);
这个str1的结果比原来从工程登记表中读取的工程编号少了几位——只是取了前十位填入了
施工单位的工程编号中!这是为什么?是不是 bb:=sgdw.Locate('gcbh;sgdw',vararrayof([str1,str2]),[]);
这句的问题?这怎么改呢?请求帮助呀!小弟急用!
var str1,str2:string;
bb:boolean;
begin
if (not gcdj.IsEmpty) and (not cydwdm.IsEmpty) then //如果工程登记和来源单位表不为空
begin
str1:=gcdj.FieldByName('gcbh').asstring;//读取工程登记表中的工程编号字段等于str1
str2:=DBlookupcombobox3.Text ;//读取来源单位等于str2
bb:=sgdw.Locate('gcbh;sgdw',vararrayof([str1,str2]),[]);
if bb then
MessageDlg('已有该施工队伍!!', mtWarning, [mbOK], 0)
else begin
sgdw.Insert;
sgdw.FieldByName('sgdw').asstring:=str2;//来源单位填入施工单位表中的施工单位字段中
sgdw.Post;
sgdw.Refresh;
end;
end;
//这下面是我为了测试这个现在在施工单位中的工程编号的值
str1:=sgdw.fieldbyname('gcbh').AsString;
showmessage(str1);
这个str1的结果比原来从工程登记表中读取的工程编号少了几位——只是取了前十位填入了
施工单位的工程编号中!这是为什么?是不是 bb:=sgdw.Locate('gcbh;sgdw',vararrayof([str1,str2]),[]);
这句的问题?这怎么改呢?请求帮助呀!小弟急用!