I am receiving the
"[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied."
error when I call the"Asi.Security.SecurityContext.ImpersonateAnonymous()" method from custom code. The error does not occur when I call the Asi.iBO.IBOAdmin.InitializeSystem() call. The latter call appears to work (an SQL Profiler show activity on the DB).
I also do not get the error when connecting to the database from a direct SQLClient connection using the same connection string used for iMIS in my application calling ImpersonateAnonymous, even when I add such to the same custom code that fails with the ImpersonateAnonymous call. I can also see the target database from SQL Server Studio.
The problem seems to be specifically with this ImpersonateAnonymous() call. What connection string is the "ImpersonateAnonymous" call using to connect to the DB? Has anyone seen this before?
You need to add the
You need to add the following to your application's .config file:
<connectionStrings> <add name="DataSource.iMIS.Connection" connectionString="Data Source=myserver;User ID=sa;Password=mypassword;Initial Catalog=mydatabase" /> </connectionStrings>This is required even if you use the overload for InitializeSystem that allows you to pass the connection string.