petermeachem
Programmer
This is a bit complicated (for me anyway). I start off with a select from any old database. I want to display the fields from the select in a list box so that the user can say what each field represents. I start off with something like
SELECT a , b , c , d FROM Table1
and end up with
SELECT a AS A, b AS B, c AS c, d AS D FROM Table1
where A B C and D are the users identifiers. See what I mean?
First go was to create a recordset and read the field properties off. This is fine for simple cases but where I have
SELECT tableA.a , TableA.b , TableB.c etc, it doesn't because I just get the abcd bit. I think the properties depend on the source type which I don't know.
I can just parse it looking for SELECT "," and FROM. Is there a better way?
Actual example below.
SELECT Members.MemberID,
Members.FirstName,
Members.LastName,
Members.HomeAddress,
Members.HomeCity,
Members.HomeStateOrProvince,
Members.HomePostalCode,
Members.HomeCountry,
CommitteeMembers.CommitteePosition,
Committees.CommitteeName
FROM (Committees
INNER JOIN (CommitteeMembers
INNER JOIN Members ON
Members.MemberID = CommitteeMembers.MemberID) ON
CommitteeMembers.CommitteeID = Committees.CommitteeID)
WHERE (Committees.CommitteeName = 'meals')
I need the 'full' field name because, for instance MemberID is obviously in more than one table.
Peter Meachem
peter @ accuflight.com
SELECT a , b , c , d FROM Table1
and end up with
SELECT a AS A, b AS B, c AS c, d AS D FROM Table1
where A B C and D are the users identifiers. See what I mean?
First go was to create a recordset and read the field properties off. This is fine for simple cases but where I have
SELECT tableA.a , TableA.b , TableB.c etc, it doesn't because I just get the abcd bit. I think the properties depend on the source type which I don't know.
I can just parse it looking for SELECT "," and FROM. Is there a better way?
Actual example below.
SELECT Members.MemberID,
Members.FirstName,
Members.LastName,
Members.HomeAddress,
Members.HomeCity,
Members.HomeStateOrProvince,
Members.HomePostalCode,
Members.HomeCountry,
CommitteeMembers.CommitteePosition,
Committees.CommitteeName
FROM (Committees
INNER JOIN (CommitteeMembers
INNER JOIN Members ON
Members.MemberID = CommitteeMembers.MemberID) ON
CommitteeMembers.CommitteeID = Committees.CommitteeID)
WHERE (Committees.CommitteeName = 'meals')
I need the 'full' field name because, for instance MemberID is obviously in more than one table.
Peter Meachem
peter @ accuflight.com