[ODBC-354] SELECT Query using VBA returning wrong results Created: 2022-02-24 Updated: 2022-05-16 |
|
| Status: | Open |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jehan Oré | Assignee: | Lawrin Novitsky |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | ODBC, VBA, query | ||
| Environment: |
Windows 10 - Microsoft 365 |
||
| Description |
|
Hi all, I report a bug using ODBC connector through VBA. Assuming I have a table named 'companies' with 3 rows in there.
Then it returns the correct results:
But when doing a query with more than one field, then
The query returns this:
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 – EDIT –
I've figured out that the use of 'rsDB.CursorLocation=aduseServer' is the cause of the issue. When commenting these 2 lines, my requests seems to work well. |
| Comments |
| Comment by Jehan Oré [ 2022-02-25 ] |
|
Actually figured out that conversely to other ODBC connections, I can't use 'recordset.cursorLocation=adUseServer', which relates to this issue... |
| Comment by Jehan Oré [ 2022-02-25 ] |
|
Therefore, one should not specify any curcorLocation for a recordset, and then everything seems to work well. I can't close the ticket :/ |
| Comment by Lawrin Novitsky [ 2022-02-25 ] |
|
Thank you for your report. I don't think it needs to be closed. This looks like pretty critical issue. |
| Comment by Jehan Oré [ 2022-02-25 ] |
|
Actually, the solution seems not to come from removing the 'cursor' parameter of the recordset, but removing the 'adOpenDynamic' in the query. With the 'adOpenDynamic', I have the issue, without it, it works perfectly. |
| Comment by Lawrin Novitsky [ 2022-04-25 ] |
|
Could you please provide ODBC trace for the erroneous execution. I cannot repeat the problem so far, apparently I am doing something wrong or something important is different in my environment. Thank you in advance. |
| Comment by Lawrin Novitsky [ 2022-04-25 ] |
|
Or maybe complete testcase code, i.e. also how the resultset is read and output, could also help. But odbc trace is preferable. |
| Comment by Lawrin Novitsky [ 2022-05-16 ] |
|
Downgraded, as I could not repeat, and there is no feedback |