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 for the Script
the loading part is done with :


  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..
Do you realy want to see the code ? here we are MyCode
at the end if you need the full sorce ,i have an zip mp3inserts.zip
Compiled version with source is near here mp3inserts_full.zip



  Previous Next chapter Contents