Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-04-2009
Cristalero Cristalero is offline
Miembro
 
Registrado: ene 2009
Posts: 15
Poder: 0
Cristalero Va por buen camino
Pense que habría algun procedimiento en delphi de este tipo.

Como siempre genial!! Gracias Neftalí.
Responder Con Cita
  #2  
Antiguo 15-04-2009
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.439
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Posiblemente el TXT (CSV) sea el más sencillo.
Basta con un WHILE + un FOR, uno para el recorrido y otro para los campos.

Algo así, aunque deberás afinarlo más...

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  i, j:Integer;
  fName:string;
  TS:TStrings;
  str:string;
  typ:TFieldType;
begin
  ADOTable1.Open;
  TS := TStringList.Create();
  fName := IncludeTrailingBackslash(ExtractFilePath(Application.ExeName)) + 'export.txt';

  // Recorrido
  while not ADOTable1.Eof do begin

    Str := '';
    for i := 0 to (ADOTable1.Fields.Count - 1) do begin

      // Tipo Correcto
      typ := ADOTable1.Fields[i].DataType;

      if (typ = ftString) or (typ = ftSmallint) or (typ = ftInteger) or
         (typ = ftWord) or (typ = ftBoolean) or (typ = ftFloat) or
         (typ = ftLargeInt) or (typ = ftDate) or (typ = ftDateTime) or
         (typ = ftCurrency) or (typ = ftWideString) then begin

        Str := Str + ADOTable1.Fields[i].AsString;
        if (i <> ADOTable1.Fields.Count) then begin
          Str := Str + ',';
        end;
      end;


    end;
    TS.Add(Str);

    ADOTable1.Next;
  end;

  Memo1.Lines.AddStrings(TS);
  TS.SaveToFile(fName);


  FreeAndNil(TS);
  ADOTable1.Close();
end;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Exportar de Dbase III a C# TASP290681 .NET 2 15-11-2008 01:39:54
Problema de formatos vivamotos Firebird e Interbase 2 01-10-2007 23:49:35
Formatos numéricos amesoft Varios 1 25-02-2005 05:09:02
Formatos de celdas en Excel lgarcia Servers 1 28-01-2005 20:31:37
Varios formatos luchopriet Impresión 0 03-09-2004 04:17:17


La franja horaria es GMT +2. Ahora son las 00:44:35.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi