We are trying to exchange date between a Navision SQL server database and a native C/Side database (exchange of Customer table information) using ODBC but do not get this synchonisation working. Does anybody have any experiance with such an exchange or is there information available how to create this exchange ?
I don’t have experience with odbc. It’s possible by Dataport. You create a dataport in the two database, one for export the other for import. And you launch automaticaly the dataport at a fixed time. Edited by - fgabriels on 2002 May 08 16:58:12
Via automation and ADO:
Why not use a DTS-package in SQL-Server? You can access any ODBC Datasource with DTS for read and write. //Lars
I’ve been searching for a sample VB code using ADO to connect Navision Native database version 3.10 and found this topic. Can anyone help??? Thanks, Darren New in forum
Hi Ron, You may want to try Navision Application Server. It si designed to run Navision objects from external programs and it is used for comunications with external programs by Commerce Portal. I would recomment trying that because it is native to Navision and you would have support for it and you could even use XML to communicate with the SQL server. Regards, Cristi Nicola
I have a routine to import from NF, using C/ODBC & ADO into Excel in VB. This set of code reads only (I needed record count and that requires certain parameters - if you want to write and/or do not need record count then you can/have to set them otherwise) Also note there is a glitch I ran into, see C/ODBC ADO & SQL problems Here is code: Public Sub GetNavisionData() Dim Query Text as String Dim CountRecords As Long Dim Connect1 As ADODB.Connection Dim TableRecords As ADODB.Recordset Dim NoOfCols As Integer Dim CurrentCount As Long 'Select which fields or all “", FROM what table WHERE criterea to meet QueryText = "SELECT () FROM ““Table_Name””_ WHERE(”“Criterea/Filters”") Set Connect1 = New ADODB.Connection Connect1.Open “DSN=” + DSNName Set TableRecords = New ADODB.Recordset With TableRecords .CursorLocation = adUseClient .Open QueryText, Connect1, , , adCmdText 'check to make sure there are records retrieved If Not ((.BOF) And (.EOF)) Then .MoveFirst CountRecords = .RecordCount 'write Field names For NoOfCols = 0 To .Fields.Count - 1 Worksheets(“RawData1”).Cells(1, NoOfCols + 1).Value = .Fields(NoOfCols).Name Next End If 'write actual data - records/lines Worksheets(“RawData1”).Cells(2, 1).CopyFromRecordset TableRecords Else CountRecords = 0 End If 'If Not ((.BOF) And (.EOF)) Then End With 'TableRecords 'close out/initialize RecordSet & Connection TableRecords.Close Set TableRecords = Nothing Connect1.Close Set Connect1 = Nothing End Sub 'GetHeaderData() A similar outline/priocess works for SQL - but note problem in other post.