I try add bitmap files into foto field. I use TUniSQL.
Under OnClick event I write:
Code: Select all
unsql1->SQL->Clear();
unsql1->SQL->Add("INSERT INTO t1(foto) VALUES(:P)");
TBlob* blob = new TBlob(false);
blob->LoadFromFile("E:\b.bmp");
unsql1->ParamByName("P")->AsBlobRef = blob;
unsql1->Execute();
delete blob;
"invalid pointer operation"
When I comment delete blob; everythink works fine.
Whot I do wrong?
I think this is a reason:
unsql1->ParamByName("P")->AsBlobRef = blob;
..
delete blob;
but how I can delete blob object?
sory for my english