?
Solved

recordset.fields collection key values

Posted on 2002-04-12
7
Medium Priority
?
194 Views
Last Modified: 2008-03-06
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.)
0
Comment
Question by:hildebrand
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 

Author Comment

by:hildebrand
ID: 6936960
Oh yeah.... Thanks!
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6937050
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.
0
 

Author Comment

by:hildebrand
ID: 6937268
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!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Accepted Solution

by:
pierrecampe earned 400 total points
ID: 6937715
i have no idea what may be causing the problem
but a way to avoid it is not to use the column names but the column positions:
recordset.fields(0) to recordset.fields(recordset.fields.count-1)
0
 

Author Comment

by:hildebrand
ID: 6950605
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!
0
 
LVL 6

Expert Comment

by:pierrecampe
ID: 6954936
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

0
 

Author Comment

by:hildebrand
ID: 6954965
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question