Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I list the table names in a database?
    primarykey
    data
    text
    <p>We have an Oracle 8i database on which I have only read access. We use ODBC and MS Access to read data from that database since we don't have Oracle Client software. This works fine. I am using ADO.NET with ASP.NET. Now I want to display a list of all the tables that I see in MS Access via ODBC. I have tried this with ODBC connection in C#. I am tried the following queries to get the list of tables, which did not work.</p> <ol> <li>select table_name from dba_tables;</li> <li>select table_name from all_tables;</li> <li>select tname from tab;</li> </ol> <h2>Please help.</h2> <h2>Thanks for the response. I tried them without luck. All I want to see is the same list of tables that are available in MS Access when I use ODBC to create Linked Tables.</h2> <p>This is the function that I am using to achieve this, which does not really work the way I would have liked.</p> <pre><code>public static ArrayList GetODBCTablesList() { try { OdbcConnection DbConnection = new OdbcConnection("DSN=mydsn;UID=user1;PWD=pwd1;"); DbConnection.Open(); OdbcCommand DbCommand = DbConnection.CreateCommand(); DbCommand.CommandText = "select table_name from all_tables"; OdbcDataReader DbReader = DbCommand.ExecuteReader(); if (DbReader != null) { ArrayList TableList = new ArrayList(); while (DbReader.Read()) { TableList.Add(DbReader.GetString(0)); } DbReader.Close(); DbCommand.Dispose(); DbConnection.Close(); TableList.Sort(); TableList.TrimToSize(); return TableList; } DbCommand.Dispose(); DbConnection.Close(); return null; } catch (Exception ex) { LogHandler.WriteLogMessage(ex.GetBaseException().ToString(), true); return null; } } </code></pre> <p>This gives me a list of tables which does not contain all the tables that I see when I link tables in MS Access using ODBC.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload