Inserting into sql table via codeunit

steveblocksteveblock Member Posts: 13
edited 2010-07-01 in SQL General
Hi. Cany anyone tell me how to insert data into a SQL table via a codeunit. Specifically a SQL table that is not part of NAV. I’m just wondering if any of you have a sample of a codeunit using an OleDB (or other) connection to write data to a SQL table directly.

Thanks. steve
steve block
312-420-6935

Comments

  • kapamaroukapamarou Member Posts: 1,152
    If you are using Nav on SQL you can create a linked server and a View for your non-Nav table. Then Create a Nav table based on that view and use it as you would use a normal table...
  • pdjpdj Member Posts: 643
    Here is a simple example using ADO: http://gotcal.com/?p=230
    Regards
    Peter
  • finleybullfinleybull Member Posts: 1
    Thank you for you suggestions. I am coming to the same conclusion that I should move it through a Journal and Post. Can you point me to any documentation or sample code as to how to do that? I figure I can use my Dot Net to XML and import into a journal table. But how do you post from journal to GL? Can I simply extend an existing method? Or do I have to start from scratch on writing the GL entry? If the latter, I am back to having to code all the verification rules.

    By
    Finley Bull :)
    Handforth Dean Parking
    Long Stay Parking
Sign In or Register to comment.