Results 1 to 2 of 2

Thread: Reading fieldnames from tabel

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    Rijswijk, Holland
    Posts
    25

    Post

    Dear VB programmers,

    I made the next sentences:

    Set NewDb = NewWS.OpenDatabase("Q.MDB")
    TempStr = "select * from TABEL"
    Set NewDyn = NewDb.OpenRecordset(TempStr)

    How can I read all fieldnames from the tabel?

    Nice greetings,

    Ingrid.

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    Hi, Ingrid!
    Test it:

    Code:
    Dim x&, i&
    
    Set dbtest = OpenDatabase("d:\db1.mdb", True)
     
    With dbtest.TableDefs("Table1")
        x = .Fields.Count - 1
        For i = 0 To x
            Debug.Print .Fields(i).Name
        Next
    End With
    
    dbtest.Close
    Best regards.

    ------------------
    smalig
    [email protected]
    smalig.tripod.com

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