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. Database & SysAdmin
  3. Database
  4. tables list in access

tables list in access

Scheduled Pinned Locked Moved Database
question
3 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.
  • S Offline
    S Offline
    Silly Boy
    wrote on last edited by
    #1

    Please tell me! how can i get all tables name in access file (.mdb) ? Thanks! xyz

    N S 2 Replies Last reply
    0
    • S Silly Boy

      Please tell me! how can i get all tables name in access file (.mdb) ? Thanks! xyz

      N Offline
      N Offline
      numbrel
      wrote on last edited by
      #2

      I will assume that you do not have Access and/or can not use it. When you use the Data Adapter Configuration Wizard, it will show the tables available and after you have choosen the one(s) you want, it will show you the fields in the table.

      1 Reply Last reply
      0
      • S Silly Boy

        Please tell me! how can i get all tables name in access file (.mdb) ? Thanks! xyz

        S Offline
        S Offline
        Suman Singh
        wrote on last edited by
        #3

        Try this, this is working on SQL Server. Create Sample That Lists Tables in a Database The following sample lists tables in the SQL Server Northwind database. OleDbSchemaGuid.Tables returns those tables (including views) that are accessible to a given log on. If you specify an Object array of {Nothing, Nothing, Nothing, "TABLE"}, you filter to include only a TABLE_TYPE of TABLE. You then list the table name (TABLE_NAME) of each row in the returned schema table. 1. Start Visual Studio .NET. 2. Create a new Visual Basic Console Application project. Module1.vb is added to the project by default. 3. Open the Code window for Module1. Paste the following code into the top of the Code window, above the Module declaration: Imports System.Data Imports System.Data.OleDb 4. In the Code window, paste the following code into the Sub Main procedure. Note You must change User ID and password = to the correct values before you run this code. Make sure that User ID has the appropriate permissions to perform this operation on the database. Dim cn As New OleDbConnection() Dim schemaTable As DataTable Dim i As Integer 'Connect to the Northwind database in SQL Server. 'Be sure to use an account that has permission to list tables. cn.ConnectionString = "Provider=SQLOLEDB;Data Source=server;User ID=;Password=;Initial Catalog=Northwind" cn.Open() 'Retrieve schema information about tables. 'Because tables include tables, views, and other objects, 'restrict to just TABLE in the Object array of restrictions. schemaTable = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _ New Object() {Nothing, Nothing, Nothing, "TABLE"}) 'List the table name from each row in the schema table. For i = 0 To schemaTable.Rows.Count - 1 Console.WriteLine(schemaTable.Rows(i)!TABLE_NAME.ToString) Next i 'Explicitly close - don't wait on garbage collection. cn.Close() 'Pause Console.ReadLine()****

        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