这是我用VC++以DAO方式访问access数据库的代码,但是其中的CustomerTable表的标题显示不出来,向大家请教!代码如下:
                  m_pSet = new CDaoRecordset( &m_db );
m_pSet->Open( dbOpenDynaset, m_strSQL, dbReadOnly );
m_colCount = m_pSet->GetFieldCount();
CDaoFieldInfo m_fieldInfo;
m_list.SetExtendedStyle( LVS_EX_GRIDLINES );
CStringArray strColName;
strColName.SetSize( m_colCount );
for ( i = 0; i < m_colCount; i++ ) 
{
m_pSet->GetFieldInfo( i, m_fieldInfo );
m_strHeading = m_fieldInfo.m_strName;
strColName[i] = m_strHeading;
m_list.InsertColumn( i, m_strHeading, LVCFMT_LEFT, m_strHeading.GetLength()*12 );
}
m_list是一个listcontrol,该表中首行是UserID\Email等标题,m_strHeading能正确读出来,但好像InsertItem函数不起作用,这些标题在该列表框控件中显示不出来!向各位大侠请教!