External ODBC

Hi Is there any way with Navision, I can create a variable of type ODBC ? What I want to do is, I want to write my customer table in navision to an external database, let say B-Tree or Access I dont want to create a dataport or use the ODBC of navision, what I need is a variable that will connect to myu external DB and from there I will be able to write to it … Thank you

I don’t think so. However, you should be able to automate MS Access in a similar way that you can automatic Excel so achieve a similar effect. Django

Actually you should be able to do this if you are running Navision on SQL. In this case you can use SQL to create an external view of (e.g. an access or Excel database), and then write directly to it from Navision. The other option is to use C/PLEX, but you could be waiting a loooonnnngggg time before that is released. Last but not least, would be to write an OCX, I have done this, but it is not nice, and has the major disadvantage of requireing software to be installed on every client.

You can use ADO from Navision, writing either directly to JET or a generic ODBC data source. I have seen many example and questions on this group regarding the use of it, so try to do a search.

I had to build a codeunit reading and writing to an access database. However, I haven’t yet found or to do it using a DSN. I have to write directly to the file. Right now, I’m using the following lines: ----------------------- strDriver := ‘Provider=Microsoft.Jet.OLEDB.4.0’; // MSAcces strDataSource := ‘Data Source=c:\tmp\myDB.mdb’; // could be a DSN? strOptions := ‘Persist Security Info=False’; strConnString := strDriver + ‘;’ + strDataSource + ‘;’ + strOptions; // New connection CREATE(varConnectionDB); varConnectionDB.Open(strConnString); // opens the connection ConnectedToDB := TRUE; END; -------------------[/size=1] The connection variable is an Automation, subtype: ‘Microsoft ActiveX Data Objects 2.5 Library’.Connection You can also create recordsets to get the results of a query. If anyone needs my sample, just ask and I’ll send it to you.

quote:


Originally posted by robertc
You can use ADO from Navision, writing either directly to JET or a generic ODBC data source. I have seen many example and questions on this group regarding the use of it, so try to do a search.