ok jetzt kommt nur noch 1 fehler
[dcc32 Fehler] doku.pas(165): E2010 Inkompatible Typen: 'TDataSet' und 'class of TDataSet'
Delphi-Quellcode:
procedure tclientdatasetAfterScroll(DataSet1: TDataSet);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
uses Unit1, ABOUT;
procedure TForm2.TclientdatasetAfterScroll(DataSet1: TDataSet);
var
JpegImage: TJPEGImage;
BlobStream: TStream;
begin
if (not Form1.clientdataset1.FieldByName('Arbeitsvertragimg').IsNull) then
begin
BlobStream := Form1.clientdataset1.CreateBlobStream(Form1.clientdataset1.FieldByName('Arbeitsvertragimg'),bmRead);
JpegImage := TJPEGImage.Create;
try
JpegImage.LoadFromStream(BlobStream);
Photo.Picture.Assign(JpegImage);
Photo.Visible := True;
finally
JpegImage.Free;
BlobStream.Free;
end;
end
else
Photo.Visible := False;
end;
procedure TForm2.btnLoadClick(Sender: TObject);
var
FileStream: TFileStream;
BlobStream: TStream;
begin
if sdBlob.Execute then
begin
Form1.clientdataset1.Edit;
BlobStream := nil;
FileStream := TFileStream.Create(sdBlob.FileName,fmCreate);
try
BlobStream := Form1.clientdataset1.CreateBlobStream(Form1.clientdataset1.FieldByName('Arbeitsvertragimg'),bmRead);
FileStream.CopyFrom(BlobStream,BlobStream.Size-BlobStream.Position);
Form1.clientdataset1.Post;
TclientdatasetAfterScroll(TDataSet); // fehler 2010
finally
BlobStream.Free;
FileStream.Free;
end;
end;
end;