conversão de bcos diferentes

Delphi

01/09/2003

Olá pessoal, estou enrolado numa dúvida que gostaria muito de solucionar.
Tenho dois bcos em interbase, e gostaria de trasferir do Cadastro de Clientes de um para o outro, fiz um programinha, mas é muito registro e sempre trava e não continua, será que não existe uma maneira mais fácil de fazer isso, pelo interbase por exemplo, sei lá!!

Me ajudem!! Valeu!
:)


Mlee

Mlee

Curtidas 0

Respostas

Mlee

Mlee

01/09/2003

up


GOSTEI 0
Mlee

Mlee

01/09/2003

up2


GOSTEI 0
Aroldo Zanela

Aroldo Zanela

01/09/2003

Coloca um fragmento do código que está falhando pra gente verificar.


GOSTEI 0
Mlee

Mlee

01/09/2003

oi, espero que dê pra entender.....

Shopp.QyClientes.First;
while not Shopp.QyClientes.Eof do
begin
if not Pegou( Novo.QyClientes,´CGCCLIE´,Shopp.QyClientesCGCCLIE.Value],´´,false) then
begin
Novo.QyClientes.Append;
Novo.QyClientesCGCCLIE.Value := Shopp.QyClientesCGCCLIE.Value;
Novo.QyClientesRAZAO.Value := Shopp.QyClientesRAZAO.Value;
Novo.QyClientesENDERECO.Value := Shopp.QyClientesENDERECO.Value;
Novo.QyClientesNUMERO.Value := Shopp.QyClientesNUMERO.Value;
Novo.QyClientesCOMPLEMENTO.Value := Shopp.QyClientesCOMPLEMENTO.Value;
Etc....(todos os campos)

Novo.QyClientes.Post;
GravaQuery(Novo.Database,Novo.QyClientes);
end;
Shopp.QyClientes.Next;
G1.Progress := G1.Progress + 1;
end;


já agradeço só por ter examindo......


GOSTEI 0
Aroldo Zanela

Aroldo Zanela

01/09/2003

Colega,

[quote:961c8792a4=´Delphi6 - Help´]
Assume that you have two IBDatabase connections with an IBSQL component associated with each (named IBSQL1 and IBSQL2, here). The connections are active and transactions started. The columns described by the select statement and the insert statement must be of the same size and type for a ´RAW´ transfer.

Here is a raw file conversion example:
[/quote:961c8792a4]

procedure TForm1.Button1Click(Sender: TObject);
var
  Filename : String;
  RawOutput : TIBOutputRawFile;
  RawInput : TIBInputRawFile;
begin
  IBSQL1.Sql.Text := ´Select firstname, lastname from people´;
  IBSQL2.Sql.Text := ´Insert into people (firstname, lastname) values
(:first, :last)´;
  Filename := ´DataFile.RAW´;
  RawOutput:= TIBOutputRawFile.Create;
  try
    RawOutput.FileName := FileName;
    IBSQL1.BatchOutput(RawOutput);
  finally
    RawOutput.Free;
  end;

  RawInput := TIBInputRawFile.Create;
  try
    RawInput.FileName := FileName;
    IBSQL2.BatchInput(RawInput);
  finally
    RawInput.Free;
  end;
  IBSQL2.Transaction.CommitRetaining;
end;



GOSTEI 0
POSTAR