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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans