Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

NAV 2013 R2 Job Queues & ADO Connection

Posted on by Microsoft Employee

Hi,

I have created a codeunit whereby I am connecting to a SQL Server 2012 database. In the codeunit, I have created a function OpenConnection which contains the piece of code below:

IF ISCLEAR(ADOConnection) THEN

IF NOT CREATE(ADOConnection, FALSE, TRUE) THEN

ERROR('Cannot create ADO Connection automation variable');

ADOConnection.ConnectionString('Provider=SQLOLEDB;Data Source=SERVERNAME;Initial Catalog=REPLICATION_DEV;User ID=sa;Password=XXXXXXX;');

ADOConnection.Open;

When I run the codeunit manually, it connects to the SQL Server 2012 database correctly.

Now I want to setup job queue for the codeunit to run automatically. But after starting the job queue, it is saying that the ADOConnection cannot be created.

Have anyone of you ever encountered an issue like this and if so what are the steps to solve it.

Thanks.

Regards

Arvind

*This post is locked for comments

  • Rashed Profile Picture
    Rashed 3,765 on at
    RE: NAV 2013 R2 Job Queues & ADO Connection

    You cannot use Automation Variable on the server.   You need to change your code to dotnet.  here is an example.

    mibuso.com/.../using-ado-on-rtc-in-nav

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans