VB 6 was superseded in 2001 and entered end of support in 2008.
Win XP was superseded in 2008 and entered end of support in 2014.
Creating new development based on either is a poor idea; both is positively dangerous.
Add to that your query is overcomplicated
DISTINCTROW has an effect only when you select fields from some, but not all, of the tables used in the query. DISTINCTROW is ignored if your query includes only one table, or if you output fields from all tables.
And you end up with something we can't duplicate - you probably need to have a good close look at the connection string and identify which engine you are using and compare that against the system itself - if you are referencing a 64 bit DB engine in a VB6 project it's not going to work because VB6 only supports 32 bit processes.
I know we've told you this before, but ... move to a more modern OS and IDE, move to a more modern language - the level of support you can get for the ancient setup you are trying to work with is just going to cause you more and more problems as you go on.!