Results 1 to 2 of 2

Thread: ADO Problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    jerusalem
    Posts
    72

    ADO Problem

    Hi!
    I have an ADO object that connect to DB.
    How can I get a list of all tables that belong to this DB?
    (By code)
    Thank you

  2. #2
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    Dim i As Long
    Dim db As Database
    Dim AllTableDefs
    Set db = DBEngine.OpenDatabase(db)
    Set AllTableDefs = db.TableDefs

    'list the table name,List_AccessTable is a listbox control that can listing the table name
    List_AccessTable.Clear
    For i = 0 To AllTableDefs.Count - 1
    List_AccessTable.AddItem AllTableDefs(i).Name
    Next

    'del the unnecessary table
    For i = 0 To List_AccessTable.ListCount - 1
    If List_AccessTable.List(i) = "MSysAccessObjects" Or List_AccessTable.List(i) = "MSysACEs" Or List_AccessTable.List(i) = "MSysObjects" Or _
    List_AccessTable.List(i) = "MSysQueries" Or List_AccessTable.List(i) = "MSysRelationships" Or List_AccessTable.List(i) = "MSysModules" _
    Or List_AccessTable.List(i) = "MSysModules2" Then
    List_AccessTable.RemoveItem (i)
    i = i - 1
    End If
    Next i

    db.Close
    Last edited by dongaman; Sep 24th, 2001 at 08:19 PM.
    I am just aman.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width