Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

recordset.fields collection key values

Posted on 2002-04-12
7
Medium Priority
?
195 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 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