Ver Mensaje Individual
  #9  
Antiguo 13-12-2007
Avatar de thelibmx
thelibmx thelibmx is offline
Miembro
 
Registrado: mar 2007
Posts: 515
Reputación: 18
thelibmx Va por buen camino
agradesco tu ayuda en verdad, yo estoy mas perdido, pero algo bueno siempre se aprende, se supone que blob esta declarado como Tstream, aun con el QuotedStr sigue marcando el mismo error, creo que hay algo que se esta pasando o tal ves es la manera incorrecta de hacerlo

Código Delphi [-]
procedure TFrmenuu.BitBtn1Click(Sender: TObject);
var
blob:TStream;
blobf:TBlobField;
fs:tstream;
begin
if OpenDialog.Execute then
begin
Olecontainer1.CreateObjectFromFile(PChar(OpenDialog.FileName),false);
vertbar.max:= Olecontainer1.Height;
horzbar.max:= Olecontainer1.Height;
Panelcontenedor.Visible:=true;
Querygestion.Close;
Querygestion.SQL.Clear;
Querygestion.SQL.add('insert into tabla_prueba(llave,nombre,archivoblob) values('+Edit1.Text+','''+tdEditAsunto.Text+''','+QuotedStr(blob)+')');
Querygestion.ExecSQL;
//Querygestion.Open;
showmessage('agregado');

blob:=querygestion.CreateBlobStream(querygestion.DataSource.DataSet.FieldByName('archivoblob'), bmwrite);
  //
  try
    blob.Seek(0, soFromBeginning);
    with TFileStream.Create(OpenDialog.FileName, fmCreate) do
      try
        CopyFrom(blob, blob.Size)
      finally
        Free
      end;
  finally
    blob.Free
  end;
end;
end;

no pense que fuera tan complicado subir un archivo a una base de datos
__________________
En movimiento...
Responder Con Cita