I'm looking for a solution to write Data from Access into a NAvision database. i don't wheather this can be done using automations and ado connections in navision code.
The 3.70B release has the new Industry wizard integrated (4.0 will be available in a few weeks I'm told). Using the Excel Mapping tool that ships with the Industry Import Wizard, you can import Excel files very easily by just mapping which cel to put in which Navision column. Fields you want to fill with a fix value, you can also setup with this tool.
This tool is integrated in the 3.70B version and can be found in the General Ledger / Setup / Setup Checklist. Choose function and then Excel mapping tool.
CANE Microsoft Solutions BV
Prins Hendrikplein 14
2518 JC DEN HAAG
The Netherlands http://www.cane.nl
Hi,
this is an example for an export into an Access
Database which has an predefined Item Table
Use the automation server variable "AcApp" for the application
and create an SQL Statement , then use DoCmd.RunSQL
Import should be similar. Make sure Access is NOT running or you will get
a error message in the first code line.
CREATE(Acapp);
AcApp.OpenCurrentDatabase('C:\test.mdb',TRUE);
AcApp.DoCmd.RunSQL('DELETE * FROM ITEM');
NoOfRec := Item.COUNT;
Window.OPEN('Item #1######### of #2#############',pos,NoOfRec);
Item.FIND('-');
REPEAT
Item.Description := DELCHR(Item.Description,'=','"');
Item."Description 2" := DELCHR(Item."Description 2",'=','"');
SQLString:='INSERT INTO Item VALUES ('
+'"'+Item."No."
+'","'
+Item.Description
+'","'
+Item."Description 2"
+'","'
+Item."Vendor Item No."
+'","'
+Item."Base Unit of Measure"
+'","'
+FORMAT(Item."Unit Price")
+'")';
AcApp.DoCmd.RunSQL(SQLString);
pos +=1;
Window.UPDATE;
UNTIL Item.NEXT = 0;
AcApp.CloseCurrentDatabase();
Comments
What kind of data are you talking about? Master data, Journal Entries?
Do you want to do this once or you want to be done peridically?
You can do this with alot of ways...
I suggest you export your tables to text and import them with dataports.
Arhontis
https://forum.mibuso.com/search
The 3.70B release has the new Industry wizard integrated (4.0 will be available in a few weeks I'm told). Using the Excel Mapping tool that ships with the Industry Import Wizard, you can import Excel files very easily by just mapping which cel to put in which Navision column. Fields you want to fill with a fix value, you can also setup with this tool.
This tool is integrated in the 3.70B version and can be found in the General Ledger / Setup / Setup Checklist. Choose function and then Excel mapping tool.
Prins Hendrikplein 14
2518 JC DEN HAAG
The Netherlands
http://www.cane.nl
this is an example for an export into an Access
Database which has an predefined Item Table
Use the automation server variable "AcApp" for the application
and create an SQL Statement , then use DoCmd.RunSQL
Import should be similar. Make sure Access is NOT running or you will get
a error message in the first code line.
CREATE(Acapp);
AcApp.OpenCurrentDatabase('C:\test.mdb',TRUE);
AcApp.DoCmd.RunSQL('DELETE * FROM ITEM');
NoOfRec := Item.COUNT;
Window.OPEN('Item #1######### of #2#############',pos,NoOfRec);
Item.FIND('-');
REPEAT
Item.Description := DELCHR(Item.Description,'=','"');
Item."Description 2" := DELCHR(Item."Description 2",'=','"');
SQLString:='INSERT INTO Item VALUES ('
+'"'+Item."No."
+'","'
+Item.Description
+'","'
+Item."Description 2"
+'","'
+Item."Vendor Item No."
+'","'
+Item."Base Unit of Measure"
+'","'
+FORMAT(Item."Unit Price")
+'")';
AcApp.DoCmd.RunSQL(SQLString);
pos +=1;
Window.UPDATE;
UNTIL Item.NEXT = 0;
AcApp.CloseCurrentDatabase();