Pабота с Image (MS SQL)
подключаюсь через АДО
ADOTable1->Edit();
((TBlobField *) ADOTable1->FieldByName("foto"))->LoadFromFile(FileListBox1->FileName);
ADOTable1->Post();
вроде вот так нужно вынимать, но не работает...
ADOQuery1->Open();
int MemSize;
char *Buffer;
//if (!ADOQuery1->Eof)
//ADOQuery1->Next();
TStream *Stream = ADOQuery1->CreateBlobStream((TBlobField *)ADOQuery1->FieldByName("foto"), 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.
Image1->SetTextBuf(Buffer); // Display the buffer's contents.
}
catch (...)
{
delete Buffer;
throw;
}
delete Buffer;
}
catch (...)
{
delete Stream;
throw;
}
delete Stream;