Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Access query on ODBC linked table (Group By" causes "ODBC--Call Failed" error)

Posted on by 90

Dear all,

I hope you can help me with this matter. I created an Access 2010 database with a linked table using ODBC. When I run a query on this table using the group by parameter I get an error. I changed the query in a pass trough query, but this resolves in the same error. The goal is to summize the amounts on the customer table (Table: Detailed Cust_Ledg_ Entry) in Nav 2009.

With kind regards,

Roger

"

*This post is locked for comments

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Access query on ODBC linked table (Group By" causes "ODBC--Call Failed" error)

    hi,

    this seems to be an error with the odbc driver.

    1. option:

    create the neded view in the sql server. to do that right click on the views item (under database name) and select new view. you can create a view by writing the sql code or using a graphical designer. maybe your choice.

    be sure to write a correct sql statement. try it in a sql command window before creating the sql view.

    sample:

    SELECT Shippers.ShipperName, Employees.LastName,

    COUNT(Orders.OrderID) AS NumberOfOrders

    FROM ((Orders

    INNER JOIN Shippers

    ON Orders.ShipperID=Shippers.ShipperID)

    INNER JOIN Employees

    ON Orders.EmployeeID=Employees.EmployeeID)

    GROUP BY ShipperName,LastName;

    as you can see: ShipperName AND LastName are part of the group by clause.

    that means: if you use a group by clause nearly every field name must be part of the group by clause except the aggregate entries.

    2. option:

    why not try to create the needed query using a nav query?

    best regards

  • RogerH72 Profile Picture
    RogerH72 5 on at
    RE: Access query on ODBC linked table (Group By" causes "ODBC--Call Failed" error)

    Hi Roberto,

    Thanks for the suggestion. Can you be a little more specific, for instance how to create this view? The post doesn't provide an answer so it seems.

    Roger

  • Suggested answer
    Roberto Stefanetti Profile Picture
    Roberto Stefanetti 12,998 on at
    RE: Access query on ODBC linked table (Group By" causes "ODBC--Call Failed" error)

    hi,

    only a suggestion

    if you are using NAV 2009 on SQL Server, try to create Sql Views with sum & group by on SQL Server and after link the View in Access with ODBC.

    Great posts about this issue here:

    sl-dynamics.blogspot.it/.../creating-sql-server-views-to-show.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans