PDA

Click to See Complete Forum and Search --> : Reading fieldnames from tabel


ingrid
Oct 25th, 1999, 02:01 PM
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.

smalig
Oct 25th, 1999, 05:54 PM
Hi, Ingrid!
Test it:


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
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)