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

NAV 2013 R2 Job Queues & ADO Connection

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Rashed Profile Picture
    3,765 on at

    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

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

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans