Link to home
Start Free TrialLog in
Avatar of hildebrand
hildebrand

asked on

recordset.fields collection key values

I've got a problem with DAO, DB, and recordset objects acting slightly different on two different PCs.  Both PCs have MS DAO version 2.6 installed, which is where I thought the problem would be.  Anyway, I'm creating/opening a recordset in which I'm joining 2 tables.  I'm using "select * from table1, table2 where....".  I'm accessing the recordset.fields("xxx") collection using the key, "xxx", of the column name from the select.  For duplicate column names across both tables, PC-1 (along with most other PCs in my user community) is building the collection with key "COLUMN_NAME" and “COLUMN_NAME1".  PC-2 is building the collection with keys "COLUMN_NAME1" and "COLUMN_NAME2".  I know I can list the column names explicitly in the select to avoid the problem, but I really want to find out the source of the problem.

Question: Do you guys know what shared file, DLL, Type lib, whatever... might be "responsible" for building the recordset.fields collection, or anything else that might be the source of the difference in building the recordset.fields collection.  (I’ve used a utility “Dependency Walker” to compare the files and versions associated with DAO and everything seems to be ok.)
Avatar of hildebrand
hildebrand

ASKER

Oh yeah.... Thanks!
Personally I would avoid this sort of problem at source by using

"Select Table1.Field As T1Field, Table2.Field As T2Field"

Or similar in your select statement.
I've written the code to work with dynamic table/column names on the server DB.  I know there are arguments against doing this, but out client software distribution method is not very timely or easy, so updating the source is not my best option.  If I have to do it that way I will, but I'm still hoping to find out what's creating the collection keys differently.  Thanks anyway!
ASKER CERTIFIED SOLUTION
Avatar of pierrecampe
pierrecampe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.  I can use the column position to cycle through the objects and use the .name property to match before contining with the .value.  This works fine.
Thanks again!
Hey what's with the 'C' grade
if you dont like a suggestion then DO NOT accept it as an answer
I have a record of almost 100 straight 'A' grades and now thanks to you there is a 'C' in it
well dont count on me anymore to try to help you out in ANY way

Sorry man,  didn't know the grade point average was so important.  Are you using it to get into college.  Really.  Can I change it?  I will.  I was hoping someone would point me to the code where the keys are generated.  You didn't do that, so I thought a 'C' was appropriate.  I knew I could use the index into the collection.  I thought the 200 points were nice.  I'm a novice at experts exchange, so I'm not quite sure what's important and what's not.