[firebase-br] Conversão de dados 2

Rafael Barros - Twins rafael.barros em twins.inf.br
Ter Ago 25 17:28:57 -03 2009


Tenho fontes em delphi de um programa para realizar tal importação.
Se tiver interesse me manda email.

> De antemão obrigado pelo retorno,
>
>  
> A linguagem que estou utilizando é delphi. Realmente terei que importar os dados, inclusive já conseguí um artigo relacionado como o demonstro a seguir:
>
>
>
> ----------
>
> procedure TForm1.Button2Click(Sender: TObject);
> var
>   I: Integer;
>   Nome: string;
>   Capital: string;
>   Continente: string;
>   Area: string;
>   Populacao: string;
> begin
>   { Criar arquivo Excel }
>   { Pega o usuário logado }
>   LCID := GetUserDefaultLCID;
>   { Torna a aplicação visível }
>   ExcelApplication1.Visible[LCID] := True;
>   { Remove alertas do excel }
>   ExcelApplication1.DisplayAlerts[LCID] := False;
>   { Cria o novo arquivo }
>   WKBK := ExcelApplication1.Workbooks.Open(
>     ExtractFilePath(Application.ExeName) +
>     'country.xls', EmptyParam, EmptyParam, EmptyParam,
>     EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
>     EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
>     EmptyParam, LCID);
>
>   { Conecta a planilha (1) que será a planilha a 
> receber os dados }
>   ExcelWorksheet1.ConnectTo(WKBK.Worksheets[1] as _Worksheet);
>   { Ativa a planilha conectada }
>   ExcelWorksheet1.Activate(LCID);
>   { Torna possível fazer alterações }
>   ExcelApplication1.ScreenUpdating[LCID] := True;
>
>   with ClientDataSet1, ExcelWorksheet1 do 
>   begin
>     Open;
>     EmptyDataSet;
>     for I := 2 to Rows.Count do
>     begin  
>       Nome := Range['A' + IntToStr(I), 'A' + IntToStr(I)].Value2;
>       Capital := Range['B' + IntToStr(I), 'B' + IntToStr(I)].Value2;
>       Continente := Range['C' + IntToStr(I), 'C' + IntToStr(I)].Value2;
>       Area := Range['D' + IntToStr(I), 'D' + IntToStr(I)].Value2;
>       Populacao := Range['E' + IntToStr(I), 'E' + IntToStr(I)].Value2;
>
>       if not ((Trim(Nome) = '') and (Trim(Capital) = '') and
>         (Trim(Continente) = '') and (Trim(Area) = '') and
>         (Trim(Populacao) = '')) then 
>       begin    
>         ClientDataSet1.Append;
>         ClientDataSet1.FieldByName('NAME').AsString := Nome;
>         ClientDataSet1.FieldByName('CAPITAL').AsString := Capital;
>         ClientDataSet1.FieldByName('Continent').AsString := Continente;
>         ClientDataSet1.FieldByName('Area').AsString := Area;
>         ClientDataSet1.FieldByName('Population').AsString := Populacao;
>         ClientDataSet1.Post;
>       end
>       else
>         Break;
>     end; 
>   end;
>   ShowMessage('A importação foi realizada com êxito.');
> end;
>
>
> -------
>
> O artigo completo pode ser encontrado em:
> http://delphitodelphi.blogspot.com/2008/11/pessoal-muitas-pessoas-tem-me-enviado-e.html
>
> O problema, neste caso, é que não consigo encontrar a unit (a Unit Excel97 ) para que o código possa compilar.
>
> Agradecimentos, Everton.
>
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use: http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
>
> __________ Informação do ESET Smart Security, versão da vacina 4367 (20090825) __________
>
> A mensagem foi verificada pelo  ESET Smart Security.
>
> http://www.eset.com
>
>
>
>
>   



__________ Informação do ESET Smart Security, versão da vacina 4367 (20090825) __________

A mensagem foi verificada pelo  ESET Smart Security.

http://www.eset.com






Mais detalhes sobre a lista de discussão lista