MATLAB Answers


connectivity problems with deployed version of ADODB (SQLOLEDB Provider) connection to a Microsoft SQL Server

florian 님이 질문을 제출함. 18 May 2015
최근 활동 florian 님이 편집함. 21 May 2015
To access a Microsoft SQL Server we have successfully used ADODB and more specifically the SQLOLEDB provider in the "normal" Matlab context.
However the very same code does not work in deployed applications and since the used sqloledb.dll is provided by Windows the possible reasons are totally unclear. For example I have tried the following basic code to establish a connection:
connection_string='Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=OUR_CATALOG;Data Source=OUR_SERVER;';
conn = actxserver('ADODB.Connection');
While this code works fine in Matlab the deployed .exe (with mcc -N -m -v ADOdb_conn_test.m) brings up the error:
Error using COM.ADODB_Connection/Open
Invoke Error, Dispatch Exception:
Source: Microsoft OLE DB Provider for SQL Server
Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server existiert nicht oder Zugriff verweigert.
Error in ADOdb_conn_test (line 8)
As you can see from the connection string integrated security is used and the problem might be linked to this fact...What could be the reason that such a connection works flawlessly in Matlab but not in a deployed exe?
By the way similar troubles arise with alternative JDBC connections, even when the hints from the integrated security answer are respected...

  댓글 수: 1

After checking nearly every possible reason I finally discovered that the deployed applications have to be started from a local drive!! ...This is true for the adodb version and also for jDBC approaches...Obviously otherwise integrated security authentification won't be successfull...

로그인 to comment.

답변 수: 1

Answer by Umakant
on 20 May 2015

Hi Florian,
Looking at the error message it seems that there is an issue when you establish a connection to the server. The most portable way to deploy a standalone application that requires SQL connection is given at the link below:
You may also find the following article useful to configure the Java run time library in MATLAB with and without admin privileges:

  댓글 수: 0

로그인 to comment.

Translated by