C/ODBC connection for navision

Now a days connecting navision via c/odbc has become essential for navision programmers.

For sql reporting services,crystal reports, programmatic access via vb or c# we need this odbc driver.

It is shipped with navision attain product cd. install it to activate the driver.

 

 

Start -> Control Panel -> Administrative Tools -> Data Sources (ODBC), then switch to System DSN and click Add. We will use C/ODBC 32-bit driver. Give Data Source Name Navision, Connection – leave it Local. As the database (Database button) select \Program Files\Navision Attain\Client\database.fdb (this is demo DB).

 Open SQL Server Enterprise Manager. Open object browser on the left side, select Security and Linked Servers. With right click select New Linked Server in the context menu. In the emerging dialog window, in the menu Provider Name select Microsoft OLE DB Provider for ODBC Drivers. Let’s name our Linked Server as NAVISION. In the Data Source string type in ODBC DSN name – NAVISION in our case. Linked Server is ready. Select tables list and we now see Navision Attain tables.

Sample query:

CREATE PROCEDURE NavisionSalesReport AS
DBCC TRACEON(8765)
SELECT * FROM OPENQUERY(NAVISION, ‘SELECT * FROM Sales_Line sls, Customer cust WHERE sls.Sell_to_Customer_No_ = cust.No_’)
RETURN
GO

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s