PK attribute of fields in form sourced by queries

accessuser1023

Registered User.
Local time
Today, 10:36
Joined
Nov 12, 2012
Messages
71
all,

I have an unusual request that doesn't make sense but I'm gonna implement it anyway. I have a user that has a hugely unorthodox method of building databases. As result, I need to do the following for him:

=> Look at each field in a source query for a form, determine which fields are part of the PKs and for what table(s) those PKs belong to (whether it be a single PK or a composite key per table) and return them. I know these attributes are readable, but what I'm not finding on the web is how to get at the source table(s) behind the first-level query sources. From what I've read, I think reading the PK stuff from the lowest-level source is the only way it can be done (I don't think you can read these from a query). I can't find the enumerations and the properties I need to get this done. I don't really care about corruption because the structure is way off as it is. The person is simply satisfied to see the data appear. I've already told them about the risks of what they're doing otherwise.

anyone help me out here? thanks!
 
A DAO.Field object has .ForeignName, .SourceField, and .SourceTable properties that might be useful. DAO.Fields are present in both a DAO.Recordset and a DAO.TableDef as a member of the Fields collection. Additionally, a DAO.TableDef has an Indexes collection, and each DAO.Index object has boolean properties named .Foreign and .Primary.

hth
 
A DAO.Field object has .ForeignName, .SourceField, and .SourceTable properties that might be useful. DAO.Fields are present in both a DAO.Recordset and a DAO.TableDef as a member of the Fields collection. Additionally, a DAO.TableDef has an Indexes collection, and each DAO.Index object has boolean properties named .Foreign and .Primary.

hth
I'm enum'ing all of them as I'm writing this. I noticed all of that. This is too bad, but it looks like it's going to be a piece-meal solution. I can just see the corruption train-wreck from this.

thanks Lagbolt. Always reliable, you seem to be. :)
 

Users who are viewing this thread

Back
Top Bottom