O
Oenone
Sorry for the cross-post but I've really no idea where this is best suited.
I've an ADO.NET application which connects to a SQL Server database. I have
spent the entire morning trying to get it to connect, but eventually got it
working by setting (in the web.config file) the authentication mode to
"Windows" and the identity impersonate flag to "True". I have left the
identity username blank so that it picks up the username and password from
the IIS configuration windows.
This is working fine. However, at one stage in my application I create a COM
object and call a function within it. The COM object creates an ADO-classic
connection to the database. This connection is failing every time with the
following error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
The connection string it is using is as follows:
Provider=SQLOLEDB;SERVER=(servername);Trusted_Connection=yes;Initial
Catalog=(dbname)
The IIS web site is configured to allow Anonymous access, and it has been
provided with the username and password of a domain user account. This user
is successfully being used by the ASP.NET and ADO.NET portion of my code.
But the COM and ADO-classic seems to be ignoring these settings.
My SQL Server only has Windows Authentication enabled (I am unable to use
SQL Server authentication due to company network policies).
What can I try doing in order to get this to work? I'm tearing my hair out
with this at the moment as I just can't find a strategy to move this
forward.
My thanks in advance,
I've an ADO.NET application which connects to a SQL Server database. I have
spent the entire morning trying to get it to connect, but eventually got it
working by setting (in the web.config file) the authentication mode to
"Windows" and the identity impersonate flag to "True". I have left the
identity username blank so that it picks up the username and password from
the IIS configuration windows.
This is working fine. However, at one stage in my application I create a COM
object and call a function within it. The COM object creates an ADO-classic
connection to the database. This connection is failing every time with the
following error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
The connection string it is using is as follows:
Provider=SQLOLEDB;SERVER=(servername);Trusted_Connection=yes;Initial
Catalog=(dbname)
The IIS web site is configured to allow Anonymous access, and it has been
provided with the username and password of a domain user account. This user
is successfully being used by the ASP.NET and ADO.NET portion of my code.
But the COM and ADO-classic seems to be ignoring these settings.
My SQL Server only has Windows Authentication enabled (I am unable to use
SQL Server authentication due to company network policies).
What can I try doing in order to get this to work? I'm tearing my hair out
with this at the moment as I just can't find a strategy to move this
forward.
My thanks in advance,