# Problem with C/ODBC & MS Access

**URL:** <https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613>\
**Category:** Developers Forum\
**Created:** [March 14, 2006, 3:25am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613 "2006-03-14T03:25:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [March 14, 2006, 3:25am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/1 "2006-03-14T03:25:20Z")

</div>

Hello guys! I have a problem with queries in MS Access 2003! The problem appears when I launch some more difficult query and then for example try to sort the result by some of the fields. The error message I get is “ **ODBC–connection to ‘MyConnection’ failed** ” or sometimes “ **ODBC–call failed** ”. If I close/open MS Access, everything starts to work until next error takes place. The most interesting thing is that error usually shows when launching more complex queries=\>with easy queries everything looks much better but if I sort the easy one more than once then it stops working too! My presumption is that problem is in some kind of cache ore buffer that gets full! Please, give me some clue! Situation: Navision 3.7,MS Access 2003, Query using Navision linked tables

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [March 14, 2006, 5:36am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/2 "2006-03-14T05:36:54Z")

</div>

What exact version of C/ODBC are you using ?

---

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [March 14, 2006, 8:10am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/3 "2006-03-14T08:10:35Z")

</div>

Thomas, according to Windows ODBC information I am using version No. 3.70.00.14988 (came with first release). Why are you asking? Do you want to say that I need to try some newer one?

---

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [March 14, 2006, 8:57am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/4 "2006-03-14T08:57:12Z")

</div>

Now I have tried it with C/ODBC version 3.70.02.19516 (came with 3.70 B)… Nothing changed[B)].

---

<div class="post-metadata">

**Author:** ![nilsm](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@nilsm](https://www.dynamicsuser.net/u/nilsm)\
**Post date:** [March 14, 2006, 9:04am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/5 "2006-03-14T09:04:05Z")

</div>

Take into account that the Navision ODBC has a 250 character restriction on the query string length… don’t know if this can be the case with your complex quieres. In my case, I had to rename a couple of fields, in order to make the query string shorter… Saludos Nils

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [March 14, 2006, 9:13am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/6 "2006-03-14T09:13:58Z")

</div>

Did you try to replace the fieldname with the string “FIELD2” for field ID 2 ? This works inside C/AL and also when setting filters !!! I.e. SETVIEW() command. I could imagine that it also works with ODBC

---

<div class="post-metadata">

**Author:** ![allyban](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@allyban](https://www.dynamicsuser.net/u/allyban)\
**Post date:** [March 28, 2006, 5:18am UTC](https://www.dynamicsuser.net/t/problem-with-c-odbc-ms-access/10613/7 "2006-03-28T05:18:58Z")

</div>

I had same problem - got round it by creating new table from odbc data and then running query on that.
