ImpersonateAnonymous throwing [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

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?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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.

Connection String already in Config

Hi Eric - I already  have that. connection string in there. iboAdmin.InitalizeSystem does not use the overload - it read the same config from the same application and works.

I should also mention that the app worked last week. It is custom code on a web app that is running on a VM. The connection string points to an iMIS DB on another VM. Last week everything worked fine. However, since then I had to clone the VM with the web app and now the error is occurring in same app on the cloned VM.

Could this be related to netwrok protocols enforced in the IMIS objects or encryption?

I ran into a similar

I ran into a similar problem yesterday; I finally resolved it by restarting my SQL Server service. You might try that.

For some reason ASI

For some reason ASI Membership Webservices expects you to run SQLEXPRESS instance. If you get this error, check your sqlexpress instance is running on your webserver ( where imis15 site is running).

Unfortunately Restart Didn't work

I restarted the server but it didnt work. I will start from the top today and check everything again.

In the meantime, would it be worth it to do a full re-install of the iMIS client systems on my client machine. Currently I am simply referencing the Asi dlls from my client web app. Does Asi.Security go to some other data source beside the target IMIS database to do its work?

No, none of the ASI code

No, none of the ASI code (including Asi.Security) should be using any other data source; they all draw from the same connection string.

You might check in your .config file that there is an ImisWebServerUrl setting that points to the correct iMIS application server + virtual directory; if it's pointing at the wrong one you might get errors, although I don't know if this one would be one of them.

Solved...

Hi - I fixed the error by specifying the system server name instead of the IP address (I am wondering if Asi enforces a DB connection protocol of OLE?!). I.e i changed:

Data Server = 123.456.789.123\DataserverName

to

DataServer = ServerName\DataServerName

and it started working again.

Yes, under the covers the

Yes, under the covers the code uses OLEDB (due to some legacy code from when we supported DB2).