Autor Beitrag
joerg68
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 116

Win 2000
D5Enterprise
BeitragVerfasst: Do 12.02.04 11:20 
Ich versuche mittels einer TDBImage Komponente eine Grafik in eine Access Datenbank zu speichern.
Das DBImage ist an die datanbank angebunden.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
OpenPictureDialog1: TOpenPictureDialog;
bbGetpicture: TBitBtn;
QLogo: TADOQuery;
DBILogo: TDBImage;
DSLogo: TDataSource;

procedure
QLogo.edit; 
  if openpictureDialog1.Execute = true then
    begin
      DBIlogo.Picture.LoadFromFile(openpictureDialog1.FileName);
      QLogo.Post;
    end;


Als Fehlermeldung kommt " Nicht genügend Schlüssel informationen zum aktualisieren"
Das Feld in das in der Datenbank gespreichert werden soll ist ein OLE-Objekt.

Gruß
Jörg

_________________
Aus den Chaos sprach eine Stimme " Lächele und sei froh denn es könnte schlimmer kommen". Und ich lächelte und ich war froh.
UND ES KAM SCHLIMMER
joerg68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 116

Win 2000
D5Enterprise
BeitragVerfasst: Mi 18.02.04 11:10 
Titel: Grafiken in Access Speichern
Ich habe leider immer noch keine Lösung gefunden für mein Problem beim Speichern von Grafiken in eine Access Datenbank
Ich habe es jetzt mal mit folgenden Code ausprobiert
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
DBIlogo.Picture.LoadFromFile(openpictureDialog1.FileName);
     QLogo.Edit;
     Bild := TBitmap.Create;
     bs := TblobStream.Create(TBlobField(Qlogo.Fieldbyname('LOGO')), bmWrite);
     Bild.Assign(DBILogo.picture);
     Bild.SaveToStream(bs);
     QLogo.Post;
     Bild.free;
     bs.Free;

Leider bekomme ich zur Laufzeit einen Fehler bei der Typkonvertierung :twisted:
Kann mir jemand weiterhelfen ?? :?
Gruß
Jörg

_________________
Aus den Chaos sprach eine Stimme " Lächele und sei froh denn es könnte schlimmer kommen". Und ich lächelte und ich war froh.
UND ES KAM SCHLIMMER
KidPaddle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 351

WinXP,Linux
D7 Prof, XE7
BeitragVerfasst: Mi 18.02.04 13:58 
Da ich die gleichen Schwierigkeiten hatte und keine Lösung gefunden habe, wandle ich die Daten erst in eine hexadezimale Darstellung um und speichere das ganze in ein Memofeld ab. Beim lesen gehe ich umgekehrt vor.

Gruß
KidPaddle
joerg68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 116

Win 2000
D5Enterprise
BeitragVerfasst: Mi 18.02.04 17:07 
Titel: Speichern von Grafiken in Access
@ KidPaddle
Hast Du vielleicht noch den Code mit dem Du die Umwandlung geschrieben hast. Wie kann ich denn die Umwandlung in eine Hexadezimale Darstellung vornehmen.Um wie geht das dann umgekehrt. Was ist denn dann in der Datenbank gespeichert. Die gespeicherte Grafik soll nämlich anschließend in einem report wieder ausgegeben werden.
Gruß
Jörg

_________________
Aus den Chaos sprach eine Stimme " Lächele und sei froh denn es könnte schlimmer kommen". Und ich lächelte und ich war froh.
UND ES KAM SCHLIMMER
svenson08
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 87



BeitragVerfasst: Do 19.02.04 11:35 
Kann man in Acces überhaupt BLOB Felder verwenden ?
Ich hätte jetzt nein gesagt, wäre mir jedenfalls nicht bekannt.