For I:=0 to LB_1.Count-1 do
begin
if LB_1.Selected[I] then
begin
Jh:=Trim(Copy(LB_1.Items[I],0,13));
Rq:=Trim(Copy(LB_1.Items[I],14,40));
aq1.Close;
aq1.SQL.Text:='select * from dca02 where Jh='''+Jh+'''';
aq1.Open;
aq2.Close;
aq2.SQL.Text:='select * from jcs where Jh='''+Jh+'''';
aq2.Open;
if aq1.FieldByName('Jh').AsString=Jh then
begin
aq1.Edit;
aq1.FieldByName('Rq').AsString:=aq2.FieldValues['Rq'];
aq1.FieldByName('Cch').AsFloat:=StrToFloat(aq2.FieldValues['Cch']);
aq1.FieldByName('Cci').AsFloat:=StrToFloat(aq2.FieldValues['Cci']);
aq1.Post;
end;
end;
end;我怎么也不能把mdb中的数据写到sql数据库中,原因可能 aq1.FieldByName('Jh').AsString=Jh 结果为FLASE 但我用同样的方法可以把sql数据中的数据写到mdb中 这是为什么?
begin
if LB_1.Selected[I] then
begin
Jh:=Trim(Copy(LB_1.Items[I],0,13));
Rq:=Trim(Copy(LB_1.Items[I],14,40));
aq1.Close;
aq1.SQL.Text:='select * from dca02 where Jh='''+Jh+'''';
aq1.Open;
aq2.Close;
aq2.SQL.Text:='select * from jcs where Jh='''+Jh+'''';
aq2.Open;
if aq1.FieldByName('Jh').AsString=Jh then
begin
aq1.Edit;
aq1.FieldByName('Rq').AsString:=aq2.FieldValues['Rq'];
aq1.FieldByName('Cch').AsFloat:=StrToFloat(aq2.FieldValues['Cch']);
aq1.FieldByName('Cci').AsFloat:=StrToFloat(aq2.FieldValues['Cci']);
aq1.Post;
end;
end;
end;我怎么也不能把mdb中的数据写到sql数据库中,原因可能 aq1.FieldByName('Jh').AsString=Jh 结果为FLASE 但我用同样的方法可以把sql数据中的数据写到mdb中 这是为什么?
解决方案 »
- 如何将车衡(地磅)的外面那一电子显示屏(LCD顾客显示屏)的数据在程序中自己发送出去显示??
- 让十六进制数 在 memo1 里显示成string类型,
- 郁闷, 不知如何选择,请大家指点
- 为什么提示没有name字段啊,在线等待!!!!!!!!
- 基础问题,望有人指导
- 关于声音的问题
- ADO中有没有返回SQL服务器名列表的函数?
- 关于runtime error
- 用 在F1book控件基础上开发的崭新F1bookDraw控件全面解决Delphi下各种复杂报表的制作,预览,列宽调整,保存为Excel文件问题.此控件方便的管
- 关于动态数组
- delphi能开发出SSH功能的客户端软件吗?【征集】
- 窗體指針釋放
应该:
aq1.Sql.Text:='select Jh from dca02.....'
if aq1.Fields[0].AsString=Jh then 0为第一个字段
不知道对不对,LZ试一下吧:)
少引号了。