This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

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

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.