Can anyone give/show me a simple example of writing to navision from excel via ODBC? For example, inserting a new record into a table? Thank you. Edited by - SimonMc on 6/9/00 11:48:42 PM
While the Navision ODBC is (theoretically) two-way, Excel does not seem to have the capability to write via ODBC to a non-Excel data source. We’ve been through all the Microsoft technical information and have not been able to find anything that addresses this unless it’s buried in the VBA area. If you could use it to directly insert records, I’m sure you’d end up with plenty of data error problems, because ODBC does not do the validation at the same level as native Navision. Allen Beck President Beck Consulting Alameda, CA & Bellevue, WA firstname.lastname@example.org 800-456-8474
I was thinking of using VB Code to write to Navision, not excel itself. SimonMc
If you want to use Excel or any other VB/VBA compliant program to interact with NF, you should use the DAO 3.6 object library. Code would be something like this: Dim Db As Database Dim Rs as Recordset Set Db = DBEngine.Opendatabase(“ODBC; …”) This is actually the tricky place Set Rs = Db.OpenRecordset Rs.AddNew Rs(“Field”) = Value . Rs.Update Rs.Close Hope this helps…
I have another question pertaining odbc, here goes=> I need to create SQL queries in excel, and it is date sensitive. So i need to refer to the ‘Date’ virtual table in NF. But I am having problems inserting the ‘Date’ virtual table in my SQL queries. How do i go about this problem?