/*****start***获得列名(61)****start*****/
try
{
CString str_columnheader;
HRESULT hr;
Fields * fields = NULL;
hr = m_pRecordset->get_Fields (&fields);
long ColCount;
if(SUCCEEDED(hr))
fields->get_Count(&ColCount);
for(long i=0;i<ColCount;i++)
{
Field * field = NULL;
field = fields->GetItem((_variant_t)(i));
str_columnheader=CString((LPCTSTR)field->GetName());
//fieldsarray.Add(CString((LPCTSTR)field->GetName()));
//MessageBox(str_columnheader);
}
if(SUCCEEDED(hr))
fields->Release();
}
catch(_com_error e)
{
::MessageBox(NULL,e.ErrorMessage(),"错误",MB_OK);
return;
}
/*****end***获得列名(61)****end*****/
VC Access 获取列名
最新推荐文章于 2022-01-01 19:03:10 发布