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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Connect with a oledb from a local enviroment

(0) ShareShare
ReportReport
Posted on by 172

Hi,

I have a problem to connect with a SQL DB. When I try to send some data from AX I get this error "Exception has been thrown by the target of an invocation.[DBNETLIB[ConnectionOpen (Connect()).SQL Server does not exist or access denied. Invalid connection string attribute"

This code works already on PROD the problem I can't test new modifications for it on local machine. Any idea how to overcome it ?

connectStr = strFmt('Provider=%1;DRIVER=%2;SERVER=%3;Database=%4;Uid=%5;Pwd=%6;Trusted_Connection=no;'
            ,Parameters.SQLProvider
            ,Parameters.SQLDriver
            ,Parameters.SQLServerName
            ,Parameters.SQLServerDatabase
            ,Parameters.SQLUserName
            ,pass);

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    The first thing to test is if you can access the database using SQL Server Management Studio on your dev system. If not, clearly some firewall or other setting somewhere is blocking the access. Or you are using credentials that don't have access to the database.

    By the way, are you trying to send some data from your dev machine to an external database that is used with PROD system? That doesn't sound like a thing that you should do.

  • RadekM Profile Picture
    172 on at

    I might said it a bit wrong. I cant access it from my dev virtual machine both from AX and Management studio. But I can access it from my local machine. I have permissions both on SQL and domain.

    This DB is for outside data share. We exchange data with other company. Basically its: Prod <-> OutsideDB <-> Other company

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Clearly it's some firewall thing, and not related to x++ code at all.

    Most likely the external database doesn't allow access from the IP address of your dev virtual machine.

    So, you need to talk to the administrator of that database.

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    As I remember you need to Create System DSN under ODBC Data Source Administrator , I had similar issue when I was trying to re installing  Development Environment , just go to Run and type odbcad32.exe and then Enter , Go to your production and open ODBC Data Source Administrator then  System DSN tab and check what are the data sources defined. to do that You will need Username password for SQL Server , which you wish to connect to.

    Hope this helps,

    Regards,

    Amith Prasanna

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    Furthermore just check  whether you allowed  Port 1433 , 1434 ports through firewalls on both Servers.

    Regards,

    Amith Prasanna

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans