How to get access to an external database

I’d like to read some external data from Navision. Mentioned data is accesible by a database view in an external MS-SQL database. Im am looking for ideas for a simple but effective solution. Thanks for any ideas! Markus

You could use Microsoft ActiveX Data Objects to do it. ADO can be accessed from Navision using Automation variables. MSDN Library link for ADO:

You can also create a SQL view in your Navision database (from the SQL Server Enterprise Manager) into the external database, and create a linked table inside the Navision object designer that links to that view. From then on it behaves just like a Navision table, and yu can access data in C/AL code. Of course this only works if you’re on the SQL erver option.

Hi Nelson your suggestion using MS ActiveX Data Objects sounds interesting. Do you have some code example? Markus

Here’s a topic containing a code sample for ADO: You can find more info by searching the forum for ADO. [edit] I just remembered it’s the 2nd time someone asks me for an ADO sample ( and that on the first time I saw a sample similar to what I would post on another site: