Navision connectivity with Oracle through automation object

brijleo
Member Posts: 70
Hi,
Can anybody tell me how we can connect oracle database through navision automation object.
Thank!
Can anybody tell me how we can connect oracle database through navision automation object.
Thank!
0
Comments
-
You need to use ADO.
Check this for help: http://www.mibuso.com/forum/viewtopic.php?t=23038Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
You can check my code that I used for importing data from FoxPro. Tabele is a NAV table containig all tables in FoxPro, TableField (also NAV table) contains all fields in tables.
I used that for one-click-import of all data and then processed into batch(es).
Code has been changed but you'll see, how to use ADOName DataType Subtype Length ADOrs Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Recordset ImportData() ConnStr := 'Driver={Microsoft Visual Foxpro Driver};UID=;SourceType=DBF;SourceDB=c:\\MIT\\VSI;Exclusive=No' ; DefSetting(ConnStr) ; //RetrTables ; //RetrFields ; CLEAR(ADOrs) ; CREATE(ADOrs) ; Tabele.SETFILTER(Tabele."Tabela MSB",'<>0') ; Tabele.FIND('-') ; TableField.SETFILTER(TableField."Field NA",'<>0') ; TableField.SETRANGE(TableField."Tabela NA",Tabele."Tabela MSB") ; TableField.FIND('-') ; ConnQ := 'select ' ; REPEAT ConnQ := ConnQ+TableField."Polje MIT"+',' ; //'select pogodba,sifrk,datv,rabat100 from '+Tabele."Tabela MIT" ; UNTIL TableField.NEXT = 0 ; ConnQ := COPYSTR(ConnQ,1,STRLEN(ConnQ)-1) ; ConnQ := ConnQ+' from '+Tabele."Tabela MIT" ; ADOrs.Open(ConnQ,ADOConn) ; NoRec := 0 ; ADOrs.MoveFirst ; REPEAT NoRec += 1 ; IF NOT ADOrs.EOF THEN ADOrs.MoveNext ; UNTIL ADOrs.EOF ; ADOrs.MoveFirst ; CurrRecord := 1 ; Progress := ROUND(CurrRecord/NoRec*10000,1) ; Okno.OPEN('Tabela: #1########################\Polje: #3#'+ '############\Progress: @2@@@@@@@@@@@@@@@@@@@@@@@@',Tabele."Tabela MIT",Progress, TableField."Field NA") ; TableField.FIND('-') ; RecRef.OPEN(TableField."Tabela NA") ; REPEAT TableField.FIND('-') ; REPEAT ImportValue(TableField."Tabela NA",TableField."Field NA",FORMAT(ADOrs.Fields.Item(TableField."Polje MIT").Value)) ; UNTIL TableField.NEXT = 0 ; IF NOT RecRef.INSERT THEN RecRef.MODIFY ; CurrRecord += 1 ; IF NOT ADOrs.EOF THEN ADOrs.MoveNext ; Progress := ROUND(CurrRecord/NoRec*10000,1) ; Window.UPDATE ; //until currrecord = 5 ; UNTIL ADOrs.EOF ; Window.CLOSE ;
And function for formatting data referencing field type in NAVImportValue(Table : Integer;Field : Integer;value : Text[1024]) value := DELCHR(value,'>',' ') ; FldRef := RecRef.FIELD(Field); Len := FldRef.LENGTH; Type := FORMAT(FldRef.TYPE) ; IF (STRLEN(value) = 6) AND (FldRef.LENGTH=4) THEN EVALUATE(FldRef,value) //this is for date fields (I think so...) ELSE BEGIN value := COPYSTR(value,1,FldRef.LENGTH) ; EVALUATE(FldRef,value) ; END ; EVALUATE(FldRef,value) ;
0 -
Funny, I managed to do this without ADO even in 2004 on trialup for our Navision 3.7
A few dataports, french ^ delimiter use and a few very small VFP applications. Was whole data migration.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions