Ver Mensaje Individual
  #6  
Antiguo 26-05-2011
oktubre oktubre is offline
Miembro
 
Registrado: sep 2010
Posts: 10
Reputación: 0
oktubre Va por buen camino
tengo una ulitma duda con los strings

amigos, he probado los codigos y tengo problemas con los strings.
el famoso "invalid variant type conversion" me persigue!!!

usando
Código Delphi [-]
While Tquery1.Eof = False Do
Begin
        Memo1.Lines.Add(Concat(Tquery1['Campo1'],' ',Tquery1['Campo2'],' - ',Tquery1['Campo3']);
        Tquery1.Next;
End;
me da ese error. ya corregí el faltante de un paréntesis que termine el concat y da igual el error.
les copio lo que me funcionó pero me parece un parche medio pedorro.

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
LaLinea, Cantidad, Articulo, Precio : string ;
begin
 {*
  SELECT Cantidad, Articulo, Precio FROM DETALLE WHERE Idfactura = 33

 While Tquery1.Eof = False Do
Begin
        Memo1.Lines.Add(Concat(Tquery1['Campo1'],' ',Tquery1['Campo2'],' - ',Tquery1['Campo3']);
        Tquery1.Next;
End;

 *}

  while  Query1.Eof = False do
  begin
 Cantidad := Query1['Cantidad']      ;
 Articulo :=  Query1['Articulo']      ;
 Precio :=   Query1['Precio']          ;


 LaLinea :=  Cantidad +' # '+ Articulo + '          $'  + Precio;
  Memo1.Lines.Add(LaLinea) ;
  Query1.Next ;
  end;

uso delphi 6 y tablas paradox 7
Responder Con Cita