Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   DBImage speichern im JPG Format (https://www.delphipraxis.net/171065-dbimage-speichern-im-jpg-format.html)

Alterauge 18. Okt 2012 12:44

Datenbank: MySQL • Version: 5.5 • Zugriff über: MyConnection

DBImage speichern im JPG Format
 
Hallo,
Habe ein kleines Problem!
Hier erstmal zum Quelltext der soweit auch geht!

Delphi-Quellcode:
procedure TForm1.AdvGlowButton5Click(Sender: TObject);
begin
if MyTable2.FieldByName('StatusEinsatz').Text ='Eingang' then
 begin
 Form4.Show;
 MyTable2.Edit;
    MyTable2.FieldByName('StatusEinsatz').Text :='BMP Format';
OpenDialog1.Filter:='*.bmp|*.bmp';
    if OpenDialog1.Execute then
      try
        TBlobField(MyTable2.FieldByName('BMP')). //BMP Datei im DBImage Blob speichern
          LoadFromFile(OpenDialog1.FileName);
           EXCEPT
            ShowMessage ('Fehler beim Öffnen der Datei!');
            MyTable2.Post;
        MyTable2.Refresh;
 end;
 end;
end;
Das Bild wird in der Datenbank (Blob)gespeichert! Soweit alles gut!
Aber beim öffnen, wird nur ein Teil des Bildes angezeigt! Also im DBImage!
Warum?

DeddyH 18. Okt 2012 12:58

AW: DBImage speichern im JPG Format
 
Schau Dir Deinen try-except-Block einmal genau an. Nicht besonders sinnvoll, oder?

Alterauge 18. Okt 2012 12:59

AW: DBImage speichern im JPG Format
 
Hallo,

Kommando zurück !

Mit "LONGBLOB" geht es !:-D

DeddyH 18. Okt 2012 13:00

AW: DBImage speichern im JPG Format
 
Obwohl Du nur im Fehlerfall speicherst?


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:24 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz