同上。

解决方案 »

  1.   

    执行该SQL语句即可得到:select name from sysobjects where type='u'
      

  2.   


    void CObjTableManager::EnumAllTableInDataBase(CStringArray& cArrayTables)
    {
    CString strText;   
    CString strTableName;   //表名 SafeCloseRecordset(m_pRec);
    m_pRec=m_pSqlCon->OpenSchema(ADODB::adSchemaTables);
        m_pRec->MoveFirst();
    while(!m_pRec->ADOEOF)
    {
    strText=(LPCTSTR)(_bstr_t)m_pRec->Fields->GetItem(_bstr_t("Table_Type"))->Value;
    strText.MakeUpper();//转换成大写 Modified By vabug 030220 15:09:09
    if(strText=="TABLE")
    {
    strTableName.Format("%s",(LPCTSTR)(_bstr_t)
    m_pRec->Fields->GetItem(_bstr_t("Table_Name"))->Value);
    if(!strTableName.IsEmpty())
    cArrayTables.Add(strTableName);
    }
    m_pRec->MoveNext();
    }
    }
      

  3.   

    ms-help://MS.VSCC/MS.MSDNVS/vcsample/html/_sample_mfc_DAOVIEW.htm
      

  4.   

    DBMS里面有系统表的SQLSERVER里面好像是SYSOBJECTS你看看那个表就名白了其他的也差不多
      

  5.   

    user the OpenSchema method for the Connection Object