📄 text1.txt
字号:
/* m_list.DeleteAllItems();//删除列表中所有内容(行)
while (m_list.DeleteColumn(0));//删除列表中所有列
int index=0;
CDaoTableDefInfo TableInfo;//建立一个表定义信息对象,该对象中存放诸如表名,创建时间等信息.
// while there are tables to get information on, continue
// this is a get info by index, not name and no error
// reporting is done (specified by FALSE)
CMainFrame *pWnd=(CMainFrame *)AfxGetMainWnd();
while(index<m_pDatabase->GetTableDefCount())
{
m_pDatabase->GetTableDefInfo(index,TableInfo,AFX_DAO_ALL_INFO);
// 如果不是系统对象或隐藏对象则将其取出
if (!(TableInfo.m_lAttributes & dbSystemObject)
&& !(TableInfo.m_lAttributes & dbHiddenObject))
pWnd->m_wndComboBox.AddString(TableInfo.m_strName);
// continue loop
index += 1;
}
pWnd->m_wndComboBox.SetCurSel(0);
pWnd->m_wndComboBox.GetLBText(0,m_strTableName);
//创建新的表定义
m_pTableDef = new CDaoTableDef(m_pDatabase);
//表定义创建失败
if ((m_pTableDef) == NULL)
return ;
//打开指定的表定义
m_pTableDef->Open(m_strTableName);
int i=0;
while(i<m_pTableDef->GetFieldCount())//如果字段信息未取完
{
//取出表中字段的信息
m_pTableDef->GetFieldInfo(m_nFieldIndex,m_FieldInfo,AFX_DAO_ALL_INFO);
//添加字段信息到列表中
m_list.AddColumn(_T(m_FieldInfo.m_strName),m_nFieldIndex);
i+=1;
m_nFieldIndex+=1;
}
m_pTableDef->Close();
CDaoRecordset m_pSet(m_pDatabase);
CString sqlSelect(_T("Select * From ["));
sqlSelect += m_strTableName;
sqlSelect += _T("]");
m_pSet.Open(dbOpenDynaset,sqlSelect);
m_pSet.MoveFirst();
COleVariant var;
int f=m_pSet.GetRecordCount();
int j,s;
for(j=0;j<m_pSet.GetRecordCount();j++)
{
m_pSet.GetFieldValue(0,var);
for(s=0;s<m_nFieldIndex;s++)
{
m_pSet.GetFieldValue(s,var);
m_list.AddItem(j,s,VariantToStr(var));
}
m_pSet.MoveNext();
}
m_bIsOpen=TRUE;
GetParent()->SetWindowText(m_strTableName);
UpdateWindow();*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -