1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Option Compare Database
Sub listSchemaFields(dir, ds)
Dim f, i, conn, R, RS
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=sas.LocalProvider.1;Data Source=" & dir
Set R = conn.OpenSchema(adSchemaColumns, Array(Empty, Empty, ds))
i = 0
Do While (Not R.EOF)
i = i + 1
For Each f In R.Fields
Debug.Print f.Name; "="; f.Value
Next
R.MoveNext
Loop
R.Close
conn.Close
Set R = Nothing
Set conn = Nothing
End Sub
Sub MAIN()
Call listSchemaFields("C:\Temp", "Class")
End Sub |
Partager