uncertainty 0 Newbie Poster

Im currently using turbo explorer as IDE, kinda new to it and was testing some functionalities and ended up trying to save and load images from MySQL. So I had this one to grab images from file to form:

void __fastcall Tcharacter::openClick(TObject *Sender)
{
 OpenPictureDialog1->Execute();
 EditBox1->Text = OpenPictureDialog1->FileName;
 Image1->Picture->LoadFromFile(EditBox1->Text); 
}

then attempted to insert it into a longblob by doing this but it wont work:

void __fastcall Tcharacter::saveClick(TObject *Sender)
{
 database->dbquery->SQL->Clear();
 database->dbquery->SQL->Add("insert into img(pic)");
 database->dbquery->SQL->Add("values ("+Image1->Picture+")");
 database->dbquery->ExecSQL(); 
}

'database' as my default TADOConnection and 'dbquery' as default TADOQuery, 'img' as one of my tables and 'pic'(LONGBLOB) as one of its field. Am I missing something or should I do something else? need help. T_T

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.