trichview.com

trichview.support




load a text from a file TXT to a blob field


Return to index


Author

Message

Luis Diaz

Posted: 05/24/2004 11:17:33


I use a DbRichviewEdit to load a text from a file TXT to a blob field with

the method addNL,but when I make post of the Register it doesn't save this

text. Why?

my Code:

      while not EOF(Fichero_de_Texto) do

        begin

          ReadLn(Fichero_de_Texto,linea);

          case strtoint(copy(linea,1,2)) of

            1 : CargaOrg;

            2 : CargaTip;          

           10 : NewReg;

           11 : RegTip;

           12 : RegOrg;

           20 : RegLine;

           99 :

             begin

               Query.Post;

               Datos.Transa.Commit; 

               inc(i);

               Panel2.Caption:=Inttostr(i);

               Panel2.Repaint;

             end;

          end;

        end;

procedure TImpDecretos.NewReg;

begin

  Query.Append;

  Query.fieldByName('DECDIA_CODIGO').AsString:=copy(linea,3,8);

  Query.fieldByName('DECDIA_FECHA').AsDateTime:=strtodate(copy(linea,11,10));

  Query.fieldByName('DECDIA_DESCRIP').AsString:=copy(linea,71,60);

  Query.fieldByName('DECDIA_A_FECHA').AsDateTime:=StrtoDate(copy(linea,11,10));

end;

procedure TImpDecretos.RegTip;

begin

  Query.fieldByName('DECDIA_TIPO').AsString:=copy(linea,3,2);

  Query.fieldByName('DECDIA_A_USUARIO').AsString:=copy(linea,71,15);

end;

procedure TImpDecretos.RegOrg;

begin

  Query.fieldByName('DECDIA_ORD').AsString:=copy(linea,3,2);

end;

procedure TImpDecretos.RexistroLinea;

begin

  rve.AddNL(copy(linea,11,60),0,0);  // rve it's connected to field DECDIA_TEXTO

  rve.format;

end;





Powered by ABC Amber Outlook Express Converter