How to detect MS Access lookup fields when querying schema

G

Guest

I need to query the schema of and MS Access/Jet database and detect if a
field is a Lookup field. If so, I need to get the "Row Source Type" and "Row
Source" property values. There does not seem to be any way to do this with
ADO.NET. I am already calling OleDbConnection.GetOleDbSchemaTable to get
most bits of schema information. I am also calling
OleDbDataReader.GetSchemaTable to get other bits of schema information.
Apparently, neither of these will give me the lookup field info I need. I
have also tried using ADOX to get table and column information, but this
doesn't seem to support lookup field info either. How can I get the
information I need?
 
P

Paul Clement

¤ I need to query the schema of and MS Access/Jet database and detect if a
¤ field is a Lookup field. If so, I need to get the "Row Source Type" and "Row
¤ Source" property values. There does not seem to be any way to do this with
¤ ADO.NET. I am already calling OleDbConnection.GetOleDbSchemaTable to get
¤ most bits of schema information. I am also calling
¤ OleDbDataReader.GetSchemaTable to get other bits of schema information.
¤ Apparently, neither of these will give me the lookup field info I need. I
¤ have also tried using ADOX to get table and column information, but this
¤ doesn't seem to support lookup field info either. How can I get the
¤ information I need?

This is an Access specific implementation so you will need to use DAO. I believe the Field object
properties you are looking for are DisplayControl and RowSource.

TableDefs("orders").Fields("CustomerID").Properties("DisplayControl")
TableDefs("orders").Fields("CustomerID").Properties("RowSource")


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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