Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CDatabase question

CDatabase question

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabasecomtutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ivan Cachicatari
    wrote on last edited by
    #1

    Hi, I have a connection to a database with CDatabase via ODBC. The question is: How to retrieve all tables of the database? Bye. Ivan Cachicatari www.latindevelopers.com

    2 P 2 Replies Last reply
    0
    • I Ivan Cachicatari

      Hi, I have a connection to a database with CDatabase via ODBC. The question is: How to retrieve all tables of the database? Bye. Ivan Cachicatari www.latindevelopers.com

      2 Offline
      2 Offline
      224917
      wrote on last edited by
      #2

      See SQLTables[^]


      suhredayan
      There is no spoon.

      1 Reply Last reply
      0
      • I Ivan Cachicatari

        Hi, I have a connection to a database with CDatabase via ODBC. The question is: How to retrieve all tables of the database? Bye. Ivan Cachicatari www.latindevelopers.com

        P Offline
        P Offline
        Peter Ritchie
        wrote on last edited by
        #3

        What DBMS are you using (SQL Server, Access, etc...) PeterRitchie.com

        I 1 Reply Last reply
        0
        • P Peter Ritchie

          What DBMS are you using (SQL Server, Access, etc...) PeterRitchie.com

          I Offline
          I Offline
          Ivan Cachicatari
          wrote on last edited by
          #4

          I'm using database servers, MySQL, MSDE2000, Firebird.. I make the connection for any of this DBMS. Ivan Cachicatari www.latindevelopers.com

          P 1 Reply Last reply
          0
          • I Ivan Cachicatari

            I'm using database servers, MySQL, MSDE2000, Firebird.. I make the connection for any of this DBMS. Ivan Cachicatari www.latindevelopers.com

            P Offline
            P Offline
            Peter Ritchie
            wrote on last edited by
            #5

            Each database is slightly different when it comes to raw SQL when querying schema data. MSDE/SQL Server, for example, store some schema information in the sysobject table. For a list of table names you can run the following query:

            SELECT name
            FROM sysobjects
            WHERE (xtype = 'U')
            ORDER BY name

            For a more generic method you'll have to resort to direct calls to ODBC. There's a sample at MS that does this sort of thing with CDatabase: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/_sample_mfc_catalog2.asp[^] PeterRitchie.com

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups