hi, I'm writing code in C++builder6.
tbl_test has
id varchar
user_id varchar
facial_photo bytea
my code is like below
ZQuery1->SQL->Add("select * from tbl_test where id='0001'");
ZQuery1->Open();
if(ZQuery1->RecordCount != 0)
{
ZQuery1->Active = true;
ZQuery1->Edit();
TStream *BlobStream = ZQuery1->CreateBlobStream(
ZQuery1->FieldByName("facial_photo"), bmWrite);
TFileStream *FileStream = new TFileStream("test.jpg");
BlobStream->CopyFrom(FileStream);
ZQuery1->Post();
FileStream->Free();
BlobStream->Free();
}
ZQuery1->Close();
but I can't update this field. while I can update other fields by ZQuery1->SetData method.
What's wrong about my code??
Thank you.
Postgresql update blob field, how to
Moderators: gto, cipto_kh, EgonHugeist
-
- Fresh Boarder
- Posts: 2
- Joined: 26.12.2007, 10:09