Results 1 to 3 of 3

Thread: Using the connection object to retrieve the tabledefs number

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    6

    Question

    Hi!

    Does anyone know how do I get the tabledefs number I have in a database?

    When I used the DAO, a wrote:

    ...
    For i = 1 To db.tabledefs.Count - 1
    debug.print db.tabledefs(i).Name
    Next
    ...

    How do I do the same thing using the ADO Connection?

    Or, if possible, using another ADO object?

    Thanks a lot!!!
    []'s
    Marcelo Piazza

  2. #2
    Guest
    try somthing like this and don't forget to add a reference to ADOX (Microsoft ADO Ext. 2.1 for DDL and Security). you will need VB6 SP3.

    ***********************************************************

    Dim x As New ADOX.Catalog
    Dim t As New ADOX.Table
    Dim c As New ADOX.Column

    ' Be sure to create your own Connection-object
    Set x.ActiveConnection = GetConnection()

    For Each t in x.Tables
    Debug.Print t.Name
    For Each c In t.Columns
    Debug.Print c.Name & ", " & _
    c.Type & ", " & _
    c.DefinedSize & ", " & _
    c.Properties("Default")
    Next
    Next

    good luck

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    6

    Smile

    Thanks a lot, Sascha! It worked fine!

    []'s
    Marcelo Piazza

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