고수님들... 보시와요...
디비가 두개가 있구...
table1 은 field에 값이 있구...
table2 는 field 에 값이 없고 field명만 있어요...
table1 에서 원하는 field 값만을 table2 에 옮길려구해요...
잘 안되네요....
대강 무식하게 해 봤는데...
잘 안되네요....헤헤
고수님들의 많은 조언 부탁드립니다...
procedure TForm1.Button1Click(Sender: TObject);
begin
TB1.Open;
TB2.Open;
while TB1.EOF do
begin
TB2.Append;
TB2.FieldByName('CUSTOMCODE').value := TB1.FieldByName('CUSTOMCODE').value;
TB2.FieldByName('COMPANY').AsString := TB1.FieldByName('COMPANY').AsString;
TB2.FieldByName('TYPE').AsString := TB1.FieldByName('TYPE').AsString;
TB2.FieldByName('OPOST').AsString := TB1.FieldByName('OPOST').AsString;
TB2.FieldByName('OADDRESS').AsString := TB1.FieldByName('OADDRESS').AsString;
TB2.FieldByName('OTEL').AsString := TB1.FieldByName('OTEL').AsString;
TB2.FieldByName('HPOST').AsString := TB1.FieldByName('HPOST').AsString;
TB2.FieldByName('HADDRESS').AsString := TB1.FieldByName('HADDRESS').AsString;
TB2.FieldByName('HTEL').AsString := TB1.FieldByName('HTEL').AsString;
TB2.FieldByName('FAX').AsString := TB1.FieldByName('FAX').AsString;
TB2.FieldByName('HP').AsString := TB1.FieldByName('HP').AsString;
TB2.FieldByName('SCHOOL').AsString := TB1.FieldByName('SCHOOL').AsString;
TB2.FieldByName('CLASS').AsString := TB1.FieldByName('CLASS').AsString;
TB2.FieldByName('PNUM').AsString := TB1.FieldByName('PNUM').AsString;
TB2.Post;
TB1.Next;
end;
TB1.Close;
TB2.Close;
end;