Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection Problem to SQL Server Through a COM Object

Status
Not open for further replies.

metsey

Programmer
Mar 2, 2001
49
US
I have a ActiveX.dll that I developed. In its Initiate event it connects to a Sql Server DB. When I run the COM from a test VB6 client it works fine. But through ASP I am getting the following error:

'1/16/2002 1:57:17 PM', 'openConn', '-2147217843 - [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '\'.', 'DRIVER=SQL Server;AnsiNPW=No;Trusted_Connection=Yes;Database=eBPA;SERVER=NJ_SQL'False, 'Error while connecting to the database'

Why won't it connect through asp but will through VB6 (same pc).
 
ActiveX.dll ??? are you talking about the ActiveX control that is downloaded when you using Internet Explorer? Or are you talking about the Component registered on the server?

If you use ActiveX control then the *user* is be the logged-in user of the client PC, who usually does not have the right to connect to the server.

 
It is a COM dll that I developed and registered on my pc
(I am running IIS 5.0 and InterDev)

This is a test environment. The user is myself (and I have the permissions necessary for the SQL Server)
 
try to use sa account for your SQL server instead of the NT account (authentication).

 
Your ASP page does not run under the same security context that your application does on your desktop and therefore doesnt have the same permissions and you are using NT authentication to connect to your database.

You can add a login for the account your ASP page runs under (IUSR_MachineName for IIS anonymous access) to your SQLS, but as phuctran suggests, I'd use SQLS authentication ISO NT authentication. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top