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...