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 GP (Archived)

GP2010 ANSI NULL Error - VBA

(0) ShareShare
ReportReport
Posted on by 170

We are doing upgrade from GP9 to GP2010. In VBA code, we have changed the RetrieveGlobals9.retrieveuserinfo to the UserInfoGet connection object, there is no problem to get data from database. If data come from linked Server, we will see this error.

[Microsoft][SQL Native Client][SQL Server]Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.

In the GP9, we can set AnsiNPW to Yes, how can I set it in VBA code on GP2010?

Please could anybody give me advice on what to do?

Thanks a lot

*This post is locked for comments

I have the same question (0)
  • Greg Willson Profile Picture
    250 on at

    If you need to get data from a linked server, usually what you need to do is enable ANSI NULLS and ANSI WARNINGS on the datasource used to connect to the database.  The problem is with UserInfoGet, it uses the system DSN to connect to GP and for GP, that DSN should not be configured in that way.  You can't change the connection string now for the object that userinfoget returns back to you, so if you need to retreive data from a linked SQL server, what you need to do instead is you have to create your own ADO connection object to connect to the server.

    Regards,

    -Greg

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 GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans