Autor Beitrag
Ken-san
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78

WIN: XP, 2000 LINUX: SUSE
Pascal, Delphi 5 Prof, C, C++
BeitragVerfasst: Mo 10.01.05 14:44 
Hallo

Ich muss aus einer Datenbank ein blobfile auslesen und dann in meinem Programm an eine dBaseIII Datenbank übergeben. Ist ja alles schön und gut nur wie soll ich es übergeben meine Lösung sieht so aus:
ausblenden Quelltext
1:
 tblLabelsBild.BlobType := qryblobBild.BlobType;					


Aber wenn ich diese Datenbank mit einem Programm öffnen möchte kommt folgende Fehlermeldung: :roll:
ausblenden Quelltext
1:
Diese Datei besitzt nicht das dBase III format oder konnte nicht geöffnet werden.					


Meine Frage ist jetzt kann das Programm keine Blobfiles in einer Datenbank öffnen oder habe ich Sie falsch übergeben?

danke für eure Hilfe

Kenny

_________________
SNAFU: Same Normal All f*** Up
Ken-san Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78

WIN: XP, 2000 LINUX: SUSE
Pascal, Delphi 5 Prof, C, C++
BeitragVerfasst: Mo 10.01.05 16:26 
Nochmal Hallo

Ich habe jetzt ein anderes Problem. Nachdem ich mir alles nochmal durch den Kopf gehen ließ kam ich auf folgende idea:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
    s := Tstringlist.Create;

    bs := TBlobStream.Create(qryblob.FieldByName('Bild') as TBlobField, bmRead);
    s.LoadFromStream(bs);
    bs.Free;

    bs := Tblobstream.Create(tblLabels.Fieldbyname('Bild') as TblobField, bmReadwrite);
    s.SaveToStream(bs);
    bs.free;

    s.free;


Das würde wahrscheinlich auch funktionieren ABER :roll: dann kommt eine andere Fehlermeldung:

ausblenden Delphi-Quelltext
1:
Invalid class typecast					


Kann sich darunter jemand was vorstellen???
Wie bekomme ich jetzt dieses Bild da rüber?

Wäre wirklich nett, wenn mir da jemand was zu sagen würde

Gruß
Kenny

Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt.

_________________
SNAFU: Same Normal All f*** Up
MAlsleben
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 303

W2k,WinXP
D3 - DXE3 Enterprise
BeitragVerfasst: Di 11.01.05 08:32 
Hi,

meines Wissens kann dbaseIII keine Blob- Felder.

Gruß Micha.

_________________
Viele Wege führen nach Rom.
MrSpock
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 262



BeitragVerfasst: Di 11.01.05 08:46 
Hallo,

ja das stimmt. Erst dBase für Windows kennt OLE und Binary Felder. dBase III kennt zwar Memo Felder, die sind aber nur für langen Text.

_________________
Live long and prosper
MrSpock \\//
Ken-san Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78

WIN: XP, 2000 LINUX: SUSE
Pascal, Delphi 5 Prof, C, C++
BeitragVerfasst: Di 11.01.05 11:14 
Hallo,

:crying: Warum gibt mir die DBF-Componente dann die möglichkeit ein Blob einzufügen...na okey muss ich mir was anderes überlegen danke für eure Hilfe

Gruß
Kenny

_________________
SNAFU: Same Normal All f*** Up
MrSpock
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 262



BeitragVerfasst: Di 11.01.05 11:55 
Hallo Ken-san,

ich denke, dass die Binary Felder ab dBase für Windows als Blobfelder angesprochen werden können.

_________________
Live long and prosper
MrSpock \\//
pirx
Hält's aus hier
Beiträge: 1

WIN 2000
D7 Enterprice
BeitragVerfasst: Di 11.01.05 16:41 
Hallo,
Ich mach sowas eigentlich meistens über die TQuery bzw.
TIBQuery Parameter

also SQL = insert into tabname (feldname) values (:parametername)

also
zum zwischenspeichern

Stream:=TMemoryStream.Create

zum schreiben

TBlobField(qryTmp.Fields[0]).SaveToStream(Stream);

dann zurückspulen

Stream.seek(0,soFromBeginning)

zum reinladen...

Query.ParambyName('paramname').loadFromStream(Stream, ftBLOB)


eine zuweisung der Blobfelder aufeinander funktioniert leider
so nicht