Tuesday, August 27, 2013

Interfacing Dynamic AX With Eksternal Database Via ODBC with Batch Processing

When i wrote in this blog, am having difficulty and confuse how to interfacing dynamic ax with eksternal database via odbc..


Why why why.. what is happening in here.. when i execute the code via jobs, the code runs very well and succesfully insert and update the eksternal database.. but when i create runbase batch class and calling the code the syntax error will raise : Unable to log on to the database. [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified Object 'OdbcConnection' could not be created.

At Last i finally did it..
For my situation the problem is :
Succes running with jobs because  refers to the fact that you connect to the database through the user logged to the current session. When you run a Job from the AX client, this is executed with the user that runs the current AX client (the one logged to the active session);

Failed to running :
When code is executed from server in a batch job, code is executed through the user that runs the AOS windows service.

So the solutions is.. Eng Ing Eng....
CREATE ODBC WITH AOS ACCOUNT, yes IT Works Trust Me..

if there is question just email me, okay...
READ MORE - Interfacing Dynamic AX With Eksternal Database Via ODBC with Batch Processing