Ver Mensaje Individual
  #9  
Antiguo 29-10-2012
webmasterplc webmasterplc is offline
Miembro
 
Registrado: mar 2008
Posts: 275
Reputación: 17
webmasterplc Va por buen camino
Lectura y Escritura de registros en Campos Blob

Hola estoy tratando de leer y excribir campos blob, la cual tengo la estructura, hago todo pero ahora no se como traer los camos a los edit y como actualizar los registros desde los edit, aca coloco el codigo a ver si alguien me puede ayudar uso bases de datos dbisam 4.

Código Delphi [-]
procedure TformFPago.btn1Click(Sender: TObject);
 type
RegFormadePago       =Record
  TipoPago  :  integer;
  BancoTarjeta  : string[40];
  Detalle          : string[90];
  RetencionIVA  : Boolean;
  MontoBsViejos : Double;
  MontoPago        : currency;
  NoEsEfectivo  : Boolean;
  end;

AFormadePago      = Array[0..9] of RegFormadePago;
var
  fcccodigo:string;
  datospago:RegFormadePago;
  campoblob:TBlobField;
  bs:Tstream;
  codigo:string;
  SQLSelect1,cfactura:String;

begin
SQLSelect1:= 'Select * from Scuentasxcobrar where FCC_NUMERO= :fccnumero';
cfactura:=edtfactura.Text;
  sqcxc.SQL.Text := SQLSelect1;
  sqcxc.ParamByName('fccnumero').AsString:=cfactura;
    sqcxc.ExecSQL;
  sqcxc.Open;
  while not sqcxc.Eof do
  Begin
    codigo:=sqcxc.FieldByName('FCC_NUMERO').AsString;
    campoblob:=sqcxc.FieldByName('FCC_FORMAPAGO') as tblobfield;
    bs := sqcxc.CreateBlobStream(campoblob, bmRead) ;
    bs.Seek(0,sofrombeginning);
    try
       bs.read(datospago,SizeOf(RegFormadePago));
    finally
       bs.Free;
    end;
    edt1.Text:=codigo;
    edt2.Text:=currtostrf(datospago.montopago,ffCurrency,2);
    sqcxc.Next;
  End;


end;
Responder Con Cita