MFC从数据库读取文件并保存到本地
比如说:CStringsqlcmb=L"SELECTimagefromimagetable";_RecordsetPtrrec;SDBC::CSQLHelper::Exe...
比如说:
CString sqlcmb = L"SELECT image from imagetable ";
_RecordsetPtr rec;
SDBC::CSQLHelper::ExecuteSql(rec,sqlcmb);
this->m_cmbBrand.Clear();
CString sval,sname;
while(!rec->adoEOF)
{
//sval = rec->GetCollect("ITEMVALUE").bstrVal;
buffer= rec->GetCollect("ITEMNAME").bVal;
???
rec->MoveNext();
}
怎样把buffer转成图片或者3D文件 然后保存到本地? 展开
CString sqlcmb = L"SELECT image from imagetable ";
_RecordsetPtr rec;
SDBC::CSQLHelper::ExecuteSql(rec,sqlcmb);
this->m_cmbBrand.Clear();
CString sval,sname;
while(!rec->adoEOF)
{
//sval = rec->GetCollect("ITEMVALUE").bstrVal;
buffer= rec->GetCollect("ITEMNAME").bVal;
???
rec->MoveNext();
}
怎样把buffer转成图片或者3D文件 然后保存到本地? 展开
1个回答
展开全部
CString strTempFilePath = “你要保存的文件名";
CFile fileNow(strTempFilePath, CFile::modeWrite|CFile::modeCreate|CFile::typeBinary);
while()
{
fileNow.Write((BYTE *)&buffer, sizeof(DownLoadDB));
}
fileNow.Flush();
fileNow.Close();
CFile fileNow(strTempFilePath, CFile::modeWrite|CFile::modeCreate|CFile::typeBinary);
while()
{
fileNow.Write((BYTE *)&buffer, sizeof(DownLoadDB));
}
fileNow.Flush();
fileNow.Close();
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询