web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

"Invalid connection string attribute" error when validating the ODBC connection - DIXF

(0) ShareShare
ReportReport
Posted on by

Dear community,

I received this error message when I tried to validated my ODBC connection with the DIXF modul.

ODBC-error.png

I already changed my ODBC configuration to 32/64 Bit, used a system-/user-DSN on AOS and client.

Microsoft SQL Server ODBC Driver Version 06.03.9600

Running connectivity tests...

Attempting connection
Connection established
Verifying option settings
Disconnecting from server

TESTS COMPLETED SUCCESSFULLY!

When I'm using the follwing job there isn't a error message.

static void mod_ODBC_Test(Args _args)
{
    LoginProperty loginProperty;
    OdbcConnection odbcConnection;
    Statement statement;
    str sql, criteria;
    SqlStatementExecutePermission perm;
    ;

    // Set the information on the ODBC.
    loginProperty = new LoginProperty();
    loginProperty.setDSN("ODBCTEST");
    loginProperty.setDatabase("my database");

    //Create a connection to external database.
    odbcConnection = new OdbcConnection(loginProperty);

    if (odbcConnection)
    {
        sql = "my sql statement"

//Assert permission for executing the sql string. perm = new SqlStatementExecutePermission(sql); perm.assert(); //Prepare the sql statement. statement = odbcConnection.createStatement(); statement.executeUpdate(sql); //Close the connection. statement.close(); } else { error("Failed to log on to the database through ODBC."); } }

We are using AX 2012 R3 CU9.

Thanks in advance.

Regards,

Moritz


*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Crispin,

    the DMF parameters are validated successfully and working with other source types.

    Regards,

    Moritz

  • Pravasti AK Profile Picture
    2,985 on at

    Hi Moritz,

    create a system dsn or user dsn with the ax database then modify code.

    Removed loginProp.setServer and

    loginProp.setDatabase

    and replaced it with loginProp.setDSN(“[insert DSN name here]”).

    you can use like below create connectionString and define the dsnName,UID,PWD for the databse of that DSN and pass that to the loginProperty class.

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

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

  • Community Member Profile Picture
    on at

    Hi,

    this is my configuration now:

    config.png

    Unfortunately I still had the error message, so I tried a different SQL Server in my own subnet and it is valdating correctly. 

    But this is still not logical for me, because it is possible with the job, so it shouldn't be network related issue.

    Regards,

    Moritz

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans