Hi,
I use BCB6 and its components from dbExpress (like TSQLQuery, TSQLConnection...). I have already made succesfuly comunication, I can download and store to basic type columns of database, but I have problems with inserting into blob. I used following code:
Code:
void storeData()
{
TStream * BlobStream;
TFileStream * FileStream;
if (SQLQuery1->Active && OpenDialog2->Execute() )
{
if (SQLQuery1->State != dsEdit)
SQLQuery1->Edit();
BlobStream=SQLQuery1->CreateBlobStream( SQLQuery1->FieldByName("data"), bmWrite);
try
{
FileStream=new TFileStream(OpenDialog2->FileName, fmOpenRead);
try
{
BlobStream->CopyFrom(FileStream, FileStream->Size);
}
__finally
{
delete FileStream;
}
}
__finally
{
delete BlobStream;
}
}
SQLQuery1->Post();
}
When I compile it and try to use this, I get error message:
...SQLQuery Error: Dataset not in edit or read mode...