Quantcast
Channel: NAV/Navision Classic Client — mibuso.com
Viewing all articles
Browse latest Browse all 2239

Write on .mdb file from "Job Queue Entry"

$
0
0
Hi all,

I'm migrating a codeunit from 2009 to NAV2015, that uses automations to update an mdb file from "Job Queue Entry". But I can't found a way to do the same with DotNet variables whith RunOnClient=No (the code is executed from "Job Queue Entry").

In 2009 I have this variables:
Connection Automation 'Microsoft ActiveX Data Objects 2.7 Library'.Connection
RecordSet Automation 'Microsoft ActiveX Data Objects 2.7 Library'.Recordset

I'm working in a virtual machine, then server and client are the same computer.

For the connexion in 2015 I have tried two different ways:
- System.Data.Odbc.OdbcConnection.'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
- System.Data.OleDb.OleDbConnection.'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Both works with RunOnClient=Yes, but if I put RunOnClient=No I get the error:
- With OleDb: The provider 'Microsoft.Jet.OLEDB.4.0' is not registered on the local computer. (also with Microsoft.ACE.OLEDB.12.0)
(But I'm in a virtual machine where RunOnClient=Yes works)
- With Odbc: ERROR [IM002] [Microsoft] [ODBC Driver Manager] The data source name could not be found and was not specified

Code for Odbc:
ConnectionString := 'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\test\SF02A140.MDB;';
ODBCConnection := ODBCConnection.OdbcConnection();
ODBCConnection.ConnectionString(ConnectionString);
ODBCConnection.Open();

Code for OleDb:
ConnectionString := 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\test\SF02A140.MDB';
//ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test\SF02A140.MDB';
OleDbConnection := OleDbConnection.OleDbConnection();
OleDbConnection.ConnectionString(ConnectionString);
OleDbConnection.Open();

How can I do this?
Thanks a lot!!

Viewing all articles
Browse latest Browse all 2239

Trending Articles