Click to See Complete Forum and Search --> : Query pulls different results when in VB(ADO)/Access


Paladyr
12-17-2001, 11:16 AM
I know there are differences between standard query language and Access SQL, but the query I wrote basically is just like:

SELECT tbl1.field1, tbl2.field2, tbl3.field3 FROM tbl1, tbl2, tbl3
WHERE tbl1.ID = tbl2.ID AND tbl1.ID = tbl3.ID

In Access, it pulls the correct records, in the ADO code, it returns inaccurate/duplicate records. Do I just need to add tbl2.ID = tbl3.ID??? The query is a lot bigger then that but it is basically the same. I have also done it using INNER JOIN's and the same results occur; in Access it is correct, in ADO code, it is not. Thanks!

------------------
My Rig (http://www.anandtech.com/mysystemrig.html?id=13834)

Milhouse: "Remember when your dog ate my goldfish and you lied to me and said I never had a goldfish? Then why did I have the bowl Bart? Why did I have the bowl?"

Nephalim
12-17-2001, 12:52 PM
You probably need a JOIN or GROUP BY/SORT BY statement. One of these should do whatever it is that you want to do.

------------------
~ And that is my humble opinion.

When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Me

"Tink"
1 GHz Tbird on A7V, 384MB PC133 RAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM nic, Intellimouse Explorer

Paladyr
12-17-2001, 01:29 PM
Did you read my post??? I'm not trying to accomplish anything... I'm looking for an explanation of why the same exact query pulls different results when used in an ADO recordset and inside Access. Not to be rude but it doesn't sound like you read what I was asking.

------------------
My Rig (http://www.anandtech.com/mysystemrig.html?id=13834)

Milhouse: "Remember when your dog ate my goldfish and you lied to me and said I never had a goldfish? Then why did I have the bowl Bart? Why did I have the bowl?"