Just installed Nav 13. How do I get a connection via ODBC. Used it on Version 3.60
*This post is locked for comments
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.
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?
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! :-)
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.
Connection was used to download Balances from General Ledger, costs, payroll info etc
you mean import to nav or export from nav ?
Imported from Nav 3.60 to Excel.
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.
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:
- 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:
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Saurav.Dhyani 2 Super User 2025 Season 2
RK-25090803-0 1