Enumerating Table Fields in ADO?

D

DS

Anybody know a good KB or MSDN (or other) article that
shows how to programmitically list out the fields
(including type and size) of all local tables in a
database.

I've been able to enumerate tables using an ADOX examples,
but I'm stuck at getting down to the field level.
 
D

Dirk Goldgar

DS said:
Anybody know a good KB or MSDN (or other) article that
shows how to programmitically list out the fields
(including type and size) of all local tables in a
database.

I've been able to enumerate tables using an ADOX examples,
but I'm stuck at getting down to the field level.

I'd use DAO for this, not ADOX, but using ADOX you should be able to get
the necessary information out of the Columns collection of each Table
object in the catalog. I believe you'll have to interpret the Type
property of the column to see what size the field is, for field types of
fixed lengths. What have you tried, and how are you stuck?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top