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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Use X++ code to connect to external oracle database

(0) ShareShare
ReportReport
Posted on by

Good Morning All:


We would like to retreive data from an external oracle database.  We currently can do this very easily through .hta or .vbs scripts.  However, we are having trouble getting the correct syntax through AX x++.  Could anyone shed some light on how the connection code should look in x++?  Does anyone have a good example of a live connection to their oracle DB that they would be willing to share?  Should this be done using ODBC and TNS?  There are a few examples on the web of using ADO connections, but we are not sure if that is the way to go.  There are also some other examples, but nothing seemed concrete.  I am looking for a start to finish example.  Did you install oracle and configure the TNS?  Does it matter if odbc is on the server or the client?  Any help is much appreciated.

Thank you,
Brian

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    235,934 Most Valuable Professional on at
    RE: Use X++ code to connect to external oracle database

    You can use OdbcConnection class in X++, but honestly, I wouldn't do it unless you talk just about a very few fields.

    Specialized frameworks such as ADO.NET will do a lot of work for you (e.g. generates classes from tables so you can development in object-oriented way, with compile-time type control etc.). Doing it all by hand using the simple ugly API in X++ looks like a waste of time to me, even resulting in less robust code (because the lack of compilation checks etc.) and more difficult to maintain.

    If you did it on client, each client would need a direct connection to the database. Doing at AOS is much easier and usually much faster (often much closer to the database than clients, can benefit from CIL etc.).

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Rahul Shah Profile Picture

Rahul Shah 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans