如题!

解决方案 »

  1.   

    Q182831
    HOWTO: Using the ADO OpenSchema Method from Visual C++
    http://support.microsoft.com/default.aspx?scid=kb;en-us;182831
    ///This is a sample in MSDN
    ///here , m_tablesList is  a listbox
    /// goog luck!
    _bstr_t tablesNames;
    CString kooky;
    m_tablesList.ResetContent();
    UpdateData( TRUE);
    try
    {
    m_recordSet = m_connection->OpenSchema (adSchemaTables,vtMissing,vtMissing);
    while ( !m_recordSet->EOF )
    {
    tablesNames = m_recordSet->Fields->Item[L"TABLE_NAME"]->Value;
    kooky = (char*) tablesNames;
    if (kooky.Left(4) != "MSys")
    m_tablesList.AddString( kooky );
    m_recordSet->MoveNext();

    }
    }
    catch(...) {}
    UpdateData( FALSE );
    m_recordSet = NULL;
      

  2.   

    OpenSchema打开表
    就可以获得所有表名了 
    SYSTEM TABLE 为系统表名