复制数据

sxdfxr 2004-01-05 11:54:04
同一个表(A)中的两条数据ID分别为1、2,有两个字段F1、F2,我如何才能实现将ID=1中的数据复制到ID=2的记录中阿?
...全文
64 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sxdfxr 2004-01-13
  • 打赏
  • 举报
回复
结账吧,看来是没有人会回复了!
sxdfxr 2004-01-05
  • 打赏
  • 举报
回复
还有好一点方法吗?通过Update能实现吗?
wave_f 2004-01-05
  • 打赏
  • 举报
回复
var
i:integer;
begin
adotable1.Edit;
adotable1.Last;
adotable1.Insert;
for i:=0 to DBGrid1.FieldCount-1 do
begin
if adotable1.Fields[i].DataType = ftstring then adotable1.Fields[i].AsString:='';
if adotable1.Fields[i].DataType = ftdatetime then adotable1.Fields[i].Value:=date();
if adotable1.Fields[i].DataType = ftinteger then adotable1.Fields[i].Value:=0;
if adotable1.Fields[i].DataType = ftfloat then adotable1.Fields[i].Value:=0;
if adotable1.Fields[i].DataType = ftboolean then adotable1.Fields[i].Value:=true;
end;
adotable1.Post;
adotable1.Refresh; //刷新记录
DBGrid1.Refresh;
refresh;
DBGrid1.SetFocus;
超人汪 2004-01-05
  • 打赏
  • 举报
回复
学习先

5,391

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧