Finding Table Names

Is there anyway to have a program display all of the names of all of the tables in a database on a label?
James
James98765
jamesparsons@cox.net
http://www.programmersheaven.com/c/Settings/messageboard.htm

Comments

  • If you are using SQL Server, you can get a list of all the tables using a SQL query like so ...

    [code]
    SELECT Table_Name FROM Information_Schema.Tables
    [/code]

    Otherwise, you would use the OleDBConnection objects GetOleDbSchemaTable function. SOmething like ...

    [code]
    Dim schemaTable As DataTable = _
    conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
    New Object() {Nothing, Nothing, Nothing, "TABLE"})
    [/code]

    The datatable returned from this will have records describing every table object in the database.


    : Is there anyway to have a program display all of the names of all of the tables in a database on a label?
    : James
    : James98765
    : jamesparsons@cox.net
    : http://www.programmersheaven.com/c/Settings/messageboard.htm
    :

  • : If you are using SQL Server, you can get a list of all the tables using a SQL query like so ...
    :
    : [code]
    : SELECT Table_Name FROM Information_Schema.Tables
    : [/code]
    :
    : Otherwise, you would use the OleDBConnection objects GetOleDbSchemaTable function. SOmething like ...
    :
    : [code]
    : Dim schemaTable As DataTable = _
    : conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
    : New Object() {Nothing, Nothing, Nothing, "TABLE"})
    : [/code]
    :
    : The datatable returned from this will have records describing every table object in the database.
    :
    :
    : : Is there anyway to have a program display all of the names of all of the tables in a database on a label?
    : : James
    : : James98765
    : : jamesparsons@cox.net
    : : http://www.programmersheaven.com/c/Settings/messageboard.htm
    : :
    :
    : I am using a Jet OLEDB server. Do you know the syntax for that?

    James
    James98765
    jamesparsons@cox.net
    http://www.programmersheaven.com/c/Settings/messageboard.htm

  • If you are using Jet then solution two should work for you.


    : : If you are using SQL Server, you can get a list of all the tables using a SQL query like so ...
    : :
    : : [code]
    : : SELECT Table_Name FROM Information_Schema.Tables
    : : [/code]
    : :
    : : Otherwise, you would use the OleDBConnection objects GetOleDbSchemaTable function. SOmething like ...
    : :
    : : [code]
    : : Dim schemaTable As DataTable = _
    : : conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
    : : New Object() {Nothing, Nothing, Nothing, "TABLE"})
    : : [/code]
    : :
    : : The datatable returned from this will have records describing every table object in the database.
    : :
    : :
    : : : Is there anyway to have a program display all of the names of all of the tables in a database on a label?
    : : : James
    : : : James98765
    : : : jamesparsons@cox.net
    : : : http://www.programmersheaven.com/c/Settings/messageboard.htm
    : : :
    : :
    : : I am using a Jet OLEDB server. Do you know the syntax for that?
    :
    : James
    : James98765
    : jamesparsons@cox.net
    : http://www.programmersheaven.com/c/Settings/messageboard.htm
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories