i'm trying to save an image in a DB from a remote PC. I'm using C++ Builder 6.0 and i don't know why the field of the blob image is null when i insert from a different PC that localhost.
I save the jpg file into a temp file called temp.bmp and then i load using LOAD_FILE(filename) and save. When i log in in localhost, there are no problems, but from a remote insertion, it's not possible. The code is the following:
Code: Select all
TJPEGImage *j = new TJPEGImage;
j->LoadFromFile( OpenPictureDialog->FileName );
j->DIBNeeded();
Graphics::TBitmap *b = new Graphics::TBitmap();
b->Assign(j);
b->SaveToFile("C:\temp.bmp");
delete b;
delete j;
AnsiString insert = "INSERT INTO planta VALUES ("+ id +",LOAD_FILE('C:\temp.bmp'))";
MyTable->SQL->Clear();
MyTable->SQL->Add(insert);
MyTable->Execute();
grant all on DB to user@'%' with grant option;
Someone can tell me why it happens?
Thanks