Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Database large object


Jon ©   (2007-09-24 02:49:00) 

With KOLEdb to get FieldByNameAsHex how can I find the size of the returned data in bytes? (I have image stored or binary data)


Jon   (2007-09-24 18:37:00) [1]

Thanks - I am glad that it is KOLEDb and not me.

I think that adding blob support would be very useful.

MySQL VARCHAR max length is 255 before MySQL 5.0.3, and 65535 in 5.0.3 and later versions.

I shall try to hack KOLEDb, unless another method is recommended.


Vladimir Kladov   (2007-09-24 18:09:00) [2]

I did not implement blobs in KOLEDb. Certainly this may be possible but changing code (may be a lot). It seems that this is not necessary for new DB engines like MS SQL 2000 / XP: there are no more restrictions for varchar field maximum size as earlier.


Jon   (2007-09-24 12:14:00) [3]

That is what I though but I cannot get the data into the stream.
This is the code that I am trying:

var
 Stream: PStream;
 Blob: Pointer;
 QR: PQuery;
begin
 ...
 Stream := NewMemoryStream;
 try
   Blob := QR.FieldByNameAsHex['picblob'];  // Stream.Write requires var parameter
   Stream.Write(Blob,????);   // Write(var Buffer; Count: DWord)
   Stream.SaveToFile('c:\blob.bin',0,Stream.Size);
 finally
   Stream.Free;
 end;
end;

I think that I am not understanding the technique correctly.
Is there a working example to help me please? Thank you.


thaddy   (2007-09-24 03:05:00) [4]

Use a memorystream and use memorystream.size ;-)


Наверх

Титульная страница Поиск, карта сайта Написать письмо