im trying to connect to a database using odbc in x++. im always getting error that the operation failed. i double checked the server name and the database name and it still wont connect. any thoughts would be appreciated. thanks!
heres a part of my code:
;
*This post is locked for comments
Hi Macarilay ,
Hope you are good.
I am facing the very same error "ODBC operation failed.\nUnable to log on to the database.".
I tried with the suggested code change but could not fix it.
logInProperty.setDSN(systemInfo.getloginDSN());
Value is returning in this is null.
It would be great if you could help on this.
Regrds,
DAX
solved it. i created a system dsn with the ax database as my default database then i modified my code.
i removed loginProp.setServer and loginProp.setDatabase and replaced it with loginProp.setDSN("[insert DSN name here]")
worked for me.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156