Results 1 to 4 of 4

Thread: ADODB Schema

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2005
    Location
    Wellington, NZ
    Posts
    267

    ADODB Schema

    Hi

    I've opened my database as an ADODB object.

    What do I need to do to be able to nevigate through this database, to get all it's tables, and the fields in these tables.

    Thanks
    Robert

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: ADODB Schema

    To "see" db objects (tables/etc) use ADOX library instead:
    VB Code:
    1. Private Sub Command2_Click()
    2. '============================
    3. Dim tbl As ADOX.Table
    4. Dim cat As ADOX.Catalog
    5. Dim con As ADODB.Connection
    6.  
    7. On Error Resume Next
    8.  
    9.     Screen.MousePointer = vbHourglass
    10.    
    11.     Set con = New ADODB.Connection
    12.     con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\biblio.mdb;"
    13.    
    14.     Set cat = New ADOX.Catalog
    15.     Set cat.ActiveConnection = con
    16.    
    17.     For Each tbl In cat.Tables
    18.         List1.AddItem tbl.Name
    19.         'you can loop through each table to get fields
    20.     Next
    21.    
    22.     Set cat = Nothing
    23.     con.Close
    24.     Set con = Nothing
    25.    
    26.     Screen.MousePointer = vbDefault
    27.  
    28. End Sub

  3. #3
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: ADODB Schema

    Rhino - what DLL to add to project?
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  4. #4

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