Subject | TIB_Blobstream |
---|---|
Author | alvin@digi.com.ph |
Post date | 2001-04-11T03:36:07Z |
How can i convert this to TIB_Blobstream ??? Anyone ???
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int MemSize;
char *Buffer;
TBlobStream *Stream;
if (!Query1->Eof)
Query1->Next();
Stream = new TBlobStream((TBlobField *)Query1->FieldByName("Notes"),
bmRead);
try
{
MemSize = Stream->Size + 1; // add one for null terminator
Buffer = new char[MemSize]; // Allocate the memory.
try
{
Stream->Read(Buffer, MemSize); //Read Notes field into buffer.
Memo1->SetTextBuf(Buffer); // Display the buffer's contents.
}
catch (...)
{
delete Buffer;
throw;
}
delete Buffer;
}
catch (...)
{
delete Stream;
throw;
}
delete Stream;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int MemSize;
char *Buffer;
TBlobStream *Stream;
if (!Query1->Eof)
Query1->Next();
Stream = new TBlobStream((TBlobField *)Query1->FieldByName("Notes"),
bmRead);
try
{
MemSize = Stream->Size + 1; // add one for null terminator
Buffer = new char[MemSize]; // Allocate the memory.
try
{
Stream->Read(Buffer, MemSize); //Read Notes field into buffer.
Memo1->SetTextBuf(Buffer); // Display the buffer's contents.
}
catch (...)
{
delete Buffer;
throw;
}
delete Buffer;
}
catch (...)
{
delete Stream;
throw;
}
delete Stream;
}