Blobfield problem
Posted: Mon 27 Jul 2009 22:16
Hello!
Once again I have a problem.
I have a firebird 2.1 (embedded) DB with 2 Tables.
In every table there is a BLOB-Field used to store an OLE-object.
This is my code to paste a chemical structure formula into one of the ole container and into the database:
The same code with differnet compound names is used for the second ole container.
In 2nd container I can see the "image" but it is not stored in the database without exception or error message.
When I try to load the ole object from the database back in to the container with the following code:
it works with the first container/blob field/table but not with the second one.
For the second one I get a stream exception.
Whats wrong here?
Thank you.
Once again I have a problem.
I have a firebird 2.1 (embedded) DB with 2 Tables.
In every table there is a BLOB-Field used to store an OLE-object.
This is my code to paste a chemical structure formula into one of the ole container and into the database:
Code: Select all
if (UnitStructureOle->CanPaste && bReadOnly==false)
{
UnitStructureOle->Paste();
bSaveUnitBlob=true;
IBCQueryUnits->Edit();
DBEditUnitOleServer->Text=UnitStructureOle->OleClassName;
//
TStream * pUnitStr;
pUnitStr=IBCQueryUnits->CreateBlobStream(IBCQueryUnits->FieldByName("STRUCTURE"), bmWrite);
try
{
UnitStructureOle->SaveToStream(pUnitStr);
}
catch (Exception &exception)
{
//
}
pUnitStr->Free();
}
In 2nd container I can see the "image" but it is not stored in the database without exception or error message.
When I try to load the ole object from the database back in to the container with the following code:
Code: Select all
TStream * pUnitStr;
pUnitStr=IBCQueryUnits->CreateBlobStream(IBCQueryUnits->FieldByName("STRUCTURE"), bmRead);
try
{
UnitStructureOle->LoadFromStream(pUnitStr);
}
catch (Exception &exception)
{
//
}
pUnitStr->Free();
For the second one I get a stream exception.
Whats wrong here?
Thank you.