title: dynamics AX batch job through ODBC
body: <p>I have problems with an ODBC connection used in a batch job: when executed, I have the following error message : </p>
  
  <p>"The ODBC operation failed.Unable to connect to database
  Invalid connection String attribute Trusted_Connection
  Unabe to create object 'OdbcConnection' "</p>
  
  <p>I try to connect to an Access database, I use the following code:</p>
  
  <pre><code>LoginProperty                 loginProperty;
  OdbcConnection                odbcConnection;
  ;
  loginProperty = new LoginProperty();
  loginProperty.setDSN("MyDSN");
  loginProperty.setDatabase("MyDatabase");
  
  odbcConnection = new OdbcConnection(loginProperty);
  </code></pre>
  
  <p>when debugging, it crashes on odbcConnection = new OdbcConnection(loginProperty). I tested the same code in a job in local client execution, there was no problem and it worked fine(without defining login password in code or DSN). My DSN seems to be OK on AOS, I'm using AX 2009 without SP1, I saw some examples where there was login/password defined in loginProperty object , the setUserName() and setPassword() methods are not available in my AX version loginProperty object. My class is executed on server-side (as any batch job).</p>
  
  <p>Is there some particular setup to do to connect to ODBC datasource through batch job?</p>
  
  <p>any ideas or suggestions?</p>
  
  <p>thanks for your help</p>
  
  <p>Edit:AOS is running on Windows server 2003 32 bits, ODBC tested on it, works fine but doesn't work in AX through batch job</p>