Options

Inserting data from access to navision

NaveenReddyNaveenReddy Member Posts: 53
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.


Is there anyone know how to do this?

Comments

  • Options
    ArhontisArhontis Member Posts: 667
    Hi,

    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.
  • Options
    harm.poelenharm.poelen Member Posts: 36
    Hi there,

    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
  • Options
    KowaKowa Member Posts: 918
    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();
    Kai Kowalewski
Sign In or Register to comment.