CDatabase question
-
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
-
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
-
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
What DBMS are you using (SQL Server, Access, etc...) PeterRitchie.com
-
What DBMS are you using (SQL Server, Access, etc...) PeterRitchie.com
I'm using database servers, MySQL, MSDE2000, Firebird.. I make the connection for any of this DBMS. Ivan Cachicatari www.latindevelopers.com
-
I'm using database servers, MySQL, MSDE2000, Firebird.. I make the connection for any of this DBMS. Ivan Cachicatari www.latindevelopers.com
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 nameFor 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