Previous Next chapter Contents


please have some fun


you can insert in *.gdb everything you want Mp3's Jpeg exe
and it is easy to do :
first declare an field mp3file BLOB SUB_TYPE 0 SEGMENT SIZE 80
in the script wich create the gdb after that it is easy to insert:
this is the code:


qmp3.insert;
qmp3.FieldByName('id').asinteger:=1;
qmp3.FieldByName('mp3title').AsString := filename;
TempStream:=qMP3.CreateBlobStream(qMP3.FieldByName('mp3file'),bsmWrite);
MemoryStream:=TmemoryStream.Create;
MemoryStream.LoadFromFile(filename);
count:=tempStream.CopyFrom(MemoryStream,0);

qMP3.Post;

To Get the blob content back is even simpler
Look at:

if sdMP3.Execute then
(qmp3.FieldByName('mp3file') as TIB_ColumnBlob).SaveToFile(sdMp3.FileName);

the next step would bee to make an play it with winamp ...soon..



  Previous Next chapter Contents