HI.,

     I had a problem when i accessing Oracle database table values from AX 
using odbc. I write a job for accessing Oracle table. It shows the count of 
columns in that table. But i want to access the data AX automatically 
restarted. Can anyone can tell me how to access Oracle table values from AX. I 
am using AX 2009. 

 

static void ODBCCONNECT(Args _args)
{
    LoginProperty   loginProperty;
    ODBCConnection  odbcConnection;
    Statement       statement;
    ResultSet       resultSet;
    OciConnection   OciConnection;
    str             ConnectionString;
    AAODBC          table;
    str             DSN       ="AX";
    str             UserName  ="system";
    str             Password  ="ax";
    int             i =0;

    ;
    ConnectionString=strfmt("DSN=%1;UID=%2;PWD=%3",DSN,UserName,Password);

    loginProperty = new LoginProperty();
    Loginproperty.setOther(ConnectionString);

   try
   {
    odbcConnection = new ODBCConnection(loginProperty);
    if(odbcConnection)
    {
        statement = odbcConnection.createStatement();
        Resultset = statement.executeQuery("Select * from sales");
        while (Resultset.next())
        {
            i++;
            info(strfmt('Resultset %1',i));
            //print resultset.getString(1);
           // pause;
            //info(Resultset.getDate(1)));
           // info(int2str(Resultset.getInt(2)));
        }
    }
    }
    catch
        {
        error('Unexpected error');
    }

}

 

Regards.,

Suneel.
                                          
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop

Reply via email to