Problem with queries using ODBC through VBA Excel
Hi all,
I report a bug using ODBC connector through VBA. Assuming I have a table named 'companies' with 3 rows in there. When doing this query:
sqlQuery = "SELECT DISTINCT idCompany" _ & " FROM companies" _ rsDB.Open sqlQuery, conDB, adOpenDynamic Then it returns the correct results:
idCompany 1 2 3 But when doing a query with more than one field, then
sqlQuery = "SELECT DISTINCT idCompany, name" _ & " FROM companies" _ rsDB.Open sqlQuery, conDB, adOpenDynamic The query returns this:
idCompany name 1 company 1 1 company 1 2 company 2 This means that any query with more than one field selected returns the first row twice, and doesn't show the last row. Even with more than 20+ rows in my table the result is the same...
Any idea of the origin of this bug?
Thanks a lot