CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Table Names

  1. #1
    Join Date
    Nov 1999
    Location
    US NJ
    Posts
    113

    Table Names

    I used to use a little code to get the table names for my programs like this...
    Private Function GetTbl()
    Dim TblNM As String
    Dim mytest As String

    Set db = OpenDatabase(dbOPEN)
    For Each tbl In db.TableDefs

    TblNM = tbl.Name
    mytest = Left$(TblNM, 3)
    If mytest <> "MSy" Then
    List1.AddItem TblNM ' + fld.Name
    Debug.Print TblNM ', fld.Name
    End If
    Next

    End Function

    Now I am learning ADO and I don't know how to get the table names.

    Please help.

    Thank you
    Leo Koach
    [email protected]


  2. #2
    Join Date
    Dec 1999
    Posts
    4

    Re: Table Names

    Hello,
    you do not have a collection like before but you can use a 'schema', wich is much like a recordset containing all the infos you need.

    set conntemp=server.createobject("adodb.connection")
    conntemp.open parmDSN

    on error resume next
    set rsSchema=conntemp.OpenSchema(???)



    The ??? value ranges from 1 to 30, the one you are looking for is 21 but try out the others!
    bye
    Gianandrea
    http://www2.lario.com/dna


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

Featured