web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

ODBC for Nav13

(0) ShareShare
ReportReport
Posted on by

Just installed Nav 13. How do I get a connection via ODBC. Used it on Version 3.60

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    epernst Profile Picture
    1,122 on at
    RE: ODBC for Nav13

    What you most likely did in 3.60, was to use the "native" N/ODBC driver. This was build especially for Navisions own database.

    If you want to use ODBC to access NAV 2013, then you need to use the "build-in" SQL Server ODBC driver, available with Excel.

  • Suggested answer
    Alex A Profile Picture
    2,634 on at
    RE: ODBC for Nav13

    Hello, Kevin.

    I use the SQLOLEDB provider to make my connection (ADODB.Connection). However, it depends on what you are trying to do. Are you trying to connect to your SQL Server from within Excel?

  • Suggested answer
    Miguel Llorca Gómez Profile Picture
    7,019 User Group Leader on at
    RE: ODBC for Nav13

    You can connect directly to SQL by the standard way... or you can also use ODATA: msdn.microsoft.com/.../hh166950%28v=nav.70%29.aspx

    Good luck! :-)

  • Suggested answer
    keoma Profile Picture
    32,729 on at
    RE: ODBC for Nav13

    no good idea, very old tech. if you want to access systems outside nav better use web services or use .net assemblies in nav to extend functionality.

    would be helpful, if you describe your purpose in detail.

  • Community Member Profile Picture
    on at
    RE: ODBC for Nav13

    Connection was used to download Balances from General Ledger, costs, payroll info etc

  • keoma Profile Picture
    32,729 on at
    RE: ODBC for Nav13

    you mean import to nav or export from nav ?

  • Community Member Profile Picture
    on at
    RE: ODBC for Nav13

    Imported from Nav 3.60 to Excel.  

  • Suggested answer
    keoma Profile Picture
    32,729 on at
    RE: ODBC for Nav13

    i suggest to replace this data export using standard nav functionality.

    in many pages you will find something like an "export to excel" action.

    for special exports you could create your own report using table "excel buffer". this special table is intended to import/export data from/to excel.

    also have a look at the tools powerpivot and jetreports.

  • Verified answer
    keoma Profile Picture
    32,729 on at
    RE: ODBC for Nav13

    you can connect via odbc using the according .net classes.

    following sample code inserts 2 text values into an excel sheet.

    - preparation of excel file

    create a new excel file, for that sample with format excel 97-2003 xls.

    save it into folder c:\temp, call it book1.xls.

    the first sheet must have the name 'Sheet1'.

    write FName into cell A1, LName into cell B1.

    save the excel file, close excel.

    the prepared excel sheet:

    0820.odbc_2D00_excel_2D00_2.png

    - variables: set property runonclient of dotnet variables to yes

    OdbcConnection : DotNet : System.Data.Odbc.OdbcConnection.'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    Command : DotNet : System.Data.Odbc.OdbcCommand.'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    Query : Text
    CmdResult : Integer
    

    - the sample code:

    OdbcConnection := OdbcConnection.OdbcConnection;
    OdbcConnection.ConnectionString := 'Driver={Microsoft Excel Driver (*.xls)};DBQ=c:\temp\book1.xls;ReadOnly=0';
    OdbcConnection.Open;
    MESSAGE(FORMAT(OdbcConnection.State.ToString));
    
    Query := 'insert into [Sheet1$] (Fname,Lname) values (?,?)';
    Command := Command.OdbcCommand(Query, OdbcConnection);
    Command.Parameters.AddWithValue('?', 'value 1');
    Command.Parameters.AddWithValue('?', 'value 2');
    CmdResult := Command.ExecuteNonQuery;
    MESSAGE('Odbc Command Result: ' + FORMAT(CmdResult));
    
    OdbcConnection.Close;
    MESSAGE(FORMAT(OdbcConnection.State.ToString));
    
    CLEAR(OdbcConnection);
    

    result:

    0820.odbc_2D00_excel_2D00_2.png

  • Community Member Profile Picture
    on at
    RE: ODBC for Nav13

    Finally got a link via- Data, Connections, Micrososft Query, using SQL Server. I now just need to find cost totals!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans