Navision Attain Database access via C/ODBC in ASP.NET Application

Navision Software was purchased by Microsoft and now it is supported by Microsoft Business Solutions together with Microsoft Great Plains, Axapta, Solomon, Microsoft Retail Management System and Microsoft CRM. Navision has extremely strong position on mid-size European and US markets, plus it has excellent manufacturing solution. Our goal is to help IT departments to support and tune Navision with in-house expertise and skills. The topic of this article is Navision database access from ASP.NET application via C/ODBC interface. Our goal will be ASPX page accessing Navision Customers.

Let's begin

1. In our case we will use Navision Attain 3.6 with Navision Database Server, Navision Application Server and Navision Client. These components are installed on Windows XP. You also need to install C/ODBC component form Navision Attain CD.

2. Let's create ODBC DSN for Navision data access. Select Control Panel -> Administrative Tools -> Data Sources (ODBC). Then select System DSN tab and press Add button. We'll use C/ODBC 32-bit data access driver. We'll name Data Source Name Navision, Connection leave Local. As the database (Database button) select Program FilesNavision AttainClientdatabase.fdb (demo database). Then click Company button ? we'll use CRONUS demo company. It is important for C/SIDE correct database access to setup proper options for C/ODBC connection. Press Options button and look at the options available ? we'll need Identifiers parameter ? it defines identifiers types, which will be transferred to the client application. In order to work correct with MS SQL Server 2000 with C/ODBC source we need to use these type: "a-z,A-Z,0-9,_". Now DNS is done. Let's create Linked Server.

3. Open MS SQL Server Enterprise Manager. Open server tree for the server, which you plan to use, for this server open Security folder and Lined Servers. With right click select New Linked Server in context menu. In the dialog box opened in the Provider Name select Microsoft OLE DB Provider for ODBC Drivers. Let's name our Linked Server NAVISION. In Data Source string enter ODBC DSN name - NAVISION in our case. Linked Server is ready! Let's select tables list and look at the data from Navision Attain database.

4. Next we need to create small stored procedure for sales data selection. Here is the text of the procedure: SET ANSI_NULLS ON SET ANSI_WARNINGS ON GO

CREATE PROCEDURE NavisionCustomers AS

DBCC TRACEON(8765) SELECT No_, Name, Address, City, Contact FROM OPENQUERY(NAVISION, 'SELECT * FROM Customer')

RETURN

Let's clarify some points here. TRACEON(8765) directive allows us to work with the data of variable length, returned by C/ODBC driver. Without it we can not select Navision tables fields ? we will have these errors:

OLE DB error trace [Non-interface error: Unexpected data length returned for the column: ProviderName='MSDASQL', TableName='[MSDASQL]', ColumnName='Ship_to_Filter', ExpectedLength='250', ReturnedLength='1']. Server: Msg 7347, Level 16, State 1, Line 1 OLE DB provider 'MSDASQL' returned an unexpected data length for the fixed-length column '[MSDASQL].Ship_to_Filter'. The expected data length is 250, while the returned data length is 1.

OPENQUERY command opens linked server and gives it execution request, and returns record set selected. Directives ANSI_NULLS and ANSI_WARNINGS are required ? they provide the possibility of the execution for heterogeneous requests. To test the procedure you can give its name in MS SQL Query Analyzer ? EXEC NavisionCustomers

5. Now we need to create ASP.NET application. Let's use free RAD environment ASP.NET WebMatrix. You can get infor and download it at http://asp.net/webmatrix . You need .NET SDK 1.1 installed, before WebMatrix installation.

6. Launch WebMatrix, select creation of the Data Pages -> Editable Data Grid in the wizard screen. Let's keep all the defaults suggested. On the access page created we'll change the header to Navision Attain Customers, select Verdana font and the font size desired. Next place on the page the component SqlDataSourceControl and tune it's ? Connection String : server='(local)'; database='Alba';trusted_connection=true (change server and database name to your actual names), and SelectCommand ? as EXEC NavisionCustomers

7. For our Data Grid, which will show customers, define DataSource as SqlDataSourceControl1, and DatKeyField ? as No_

8. Next switch to code edition mode and make these changes:

? In the DataGrid_Delete method let's correct the request for the customer deletion to the one we need

? Change DataGrid_Delete code, base on the fields we plan to use

9. Launch our application and test it. This is it!

Happy customizing, implementing and modifying! If you want us to do the job - give us a call 1-866-528-0577 or 1-630-961-5918! help@albaspectrum.com

Boris Makushkin is Lead Software Developer in Alba Spectrum Technologies ? USA nationwide Microsoft CRM, Microsoft Great Plains customization company, serving Chicago, Boston, San Francisco, San Diego, Los Angeles, Houston, Dallas, Atlanta, Miami, Montreal, Toronto, Vancouver, Moscow, Europe and internationally ( http://www.albaspectrum.com ), he is Microsoft CRM SDK, Navision, C#, VB.Net, SQL, Oracle, Unix developer.

house refresh service Glenview .!
In The News:

After the military, some veterans are left wondering what's next? Nonprofit organization Vets to Drones is helping them take on a new path by becoming certified drone pilots.
Natasha Lopez says a Flock camera system helped a Georgia deputy track her family, and after she spoke out, a fake Facebook page targeted her children.
Data broker opt-outs may not keep your personal information private for long. Five common myths leave retirees especially vulnerable to scams.
What's Nvidia's future after the resignation of CEO Jensen Huang amid scandals? Weigh in here!
Meta's AI age-estimation technology now scans Instagram accounts worldwide, placing millions of teens into stricter safety settings automatically.
The FTC sent warning letters to 25 companies over misleading health insurance ads as open enrollment brings a surge of deceptive offers online.
Michigan's new prison scoring system claims 30% better violence prediction, but Recidiviz says it doesn't actually use AI to classify inmates.
University of Texas at Arlington researchers reveal how AI analyzes public Instagram posts to craft spear phishing emails that feel personal.
VOLTA-AUTODOXER malware uses AI to analyze stolen data and rank victims by potential value, helping criminals target the most profitable accounts.
Daimler Truck's Oregon demos show how a Freightliner Cascadia's automatic emergency braking responds when dummy cars suddenly cross a moving truck's path.
Facebook ads promising to recover stolen funds are targeting scam victims again, and Meta confirmed removing flagged accounts after investigation.
Tesla Cybertruck production is winding down at Gigafactory Texas to make room for Cybercab robotaxi manufacturing, but key questions remain for owners.
Identity theft can hide in phone accounts, medical records and utility bills long before it shows on a credit report. Eight places to check now.
JR East's towering ZIZAI ZX-3 chainsaw robot tackles dangerous branch-cutting along Japan's Koumi Line while a trained operator controls it remotely.
A massive DHS data leak exposed records of over 41,000 employees, revealing links to undercover ICE operations, Palantir tools and AI platforms.
The Fox News AI Newsletter covers the latest artificial intelligence technology advancements, including the challenges and opportunities AI presents now and for the future.
UCLA's PhoneBot turns old Android phones into the brain of a two-legged humanoid robot that walks, follows people and stands up after falling.
A fake Amazon invoice charging $988.18 for an iPad lists the same customer support phone number three times to steer panicked victims into calling.
A handful of food delivery robots from Uber Eats and other platforms have gotten kicked and knocked over in Philadelphia and Los Angeles.
Data broker opt-out forms may not protect your family. People search sites can still expose your info through a spouse's or parent's profile.
Apple's first touchscreen MacBook Pro starts at $2,899 with a PROLED XDR OLED display, but the non-touch M6 model costs $900 less at $1,999.
Black Friday deals are already drawing scammers who use fake delivery notices and gift card payment requests to steal your personal financial information.
Apple's iPhone Duo reportedly outlasted the Samsung Galaxy Z Fold 8 by over three hours in battery tests, but its weight and repair costs raise concerns.
Florida Polytechnic University's Jetson ONE eVTOL police vehicle named Astro still awaits FAA authorization before officers can fly operational patrols.
OpenAI's new locked chats feature lets you protect ChatGPT conversations with a PIN, Face ID or Touch ID, but there are key privacy limitations.

Five Tips For A Great Software Demo

Whether you need to close a sale, gather end-user feedback,... Read More

Instant Messaging is a Sweet Way to Communicate

MSN messenger is a pretty cool invention. I mean I'm... Read More

Microsoft Great Plains customization ? Freight Forwarding/Transportation industry example

Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More

Microsoft Great Plains: Getting New Users Licenses ? Annual Service Plan FAQ

Microsoft Business Solutions Great Plains, Solomon, Navision, Axapta, Microsoft CRM... Read More

Free Software: How Not To Get More Than You Bargained For!

I completed an experiment recently. I wanted to find out... Read More

Review on QuarkXpress 6.0

After almost two decades of existence, Quark has become the... Read More

Understanding XML Server

XML Server can be a Web Server that stores the... Read More

Introduction To ISDN, Part II

In the previous ISDN article, we looked at how and... Read More

Is Your Small Business Ready For A CRM Software Solution?

I have yet to see a business that, sometimes in... Read More

Groupware and Version History: Collaboration Series #1

This article is the first of a series of articles... Read More

Great Plains Bill of Materials Setup & Customization for Process Manufacturing ? Overview

Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More

OS 101: Suggestions for Choosing an Operating System

An operating system (abbreviated OS) is essentially the path through... Read More

Corporate Accounting System: Microsoft Great Plains ? Overview

Corporate ERP/MRP selection might be tough one, especially considering very... Read More

Outlook... Not Just for Email! Using Your Outlook Calendar

Microsoft Outlook is one of the most widely used software... Read More

A Time-Saving Programming Tactic that Doesn?t Work

Let's say that you have a software project that's under... Read More

New SQL Delta Version 3.1

COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More

Chinese Input - Step by Step Instruction on How to Input Chinese Characters in English Windows XP

Enabling Chinese input is quick and easy, there are only... Read More

Popular Fleet Maintenance Programs

Some companies that are in need of fleet management may... Read More

Editing Your Photos Using Microsoft Picture It Publishing Platinum 2002 - A Great Dinosaur

I started using PIP (Picture It Publishing) Platinum 2002 right... Read More

Internet Relay Chat - A Basic Introduction

What is IRC?IRC is Internet Relay Chat. It is a... Read More

Start Developing Your Own Software

Learning how to program software seems like a daunting task... Read More

Implementing ERP for Large Publicly Traded Corporation ? Microsoft Great Plains

We would like first emphasize the change in the paradigm.... Read More

Assertion in Java

Assertion facility is added in J2SE 1.4. In order to... Read More

Microsoft Great Plains Dynamics on Pervasive SQL.2000 Data Repair ? Overview For DBAs

Some introduction into Great Plains Software products, now Microsoft Business... Read More

Microsoft Great Plains GL: General Ledger ? Overview For Consultant

Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More

reliable home cleaners Winnetka .!