|
楼主 |
发表于 2020-7-19 23:30:01
|
显示全部楼层
MyQuery->SQL->Clear();
AnsiString str = "select * from TabAttachedFiles";
MyQuery->SQL->Add(str);
try
{
MyQuery->Open();
}
catch(...)
{
;
}
MyQuery->Append();
MyQuery->FieldByName("bugID")->Value = bugID;
MyQuery->FieldByName("file_name")->Value = ::ExtractFileName(dlg->FileName);
TBlobField *Field = (TBlobField*)MyQuery->FieldByName("file_data");
Field->LoadFromFile(dlg->FileName);
MyQuery->Post();//这里不行。文件比较小的时候可以,大了就不行了
MyQuery->Close();
我用的是MyDAC控件 |
|