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

조회 수: 21 (최근 30일)
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');
conn.Open(connection_string);
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)
MATLAB:COM:E2147500037
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
florian
florian 2015년 5월 21일
편집: florian 2015년 5월 21일
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...

댓글을 달려면 로그인하십시오.

답변 (1개)

Umakant
Umakant 2015년 5월 20일
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:
Thanks,
Umakant

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by