How to connect to SQL Server through ADO (SOL Server uses Integrated Security)

How to connect to SQL Server through ADO (SOL Server uses Integrated Security)

Post by Yie Wan » Sat, 05 Sep 1998 04:00:00



Hi, everyboday!  Please help me!

  I  have the following error when I run the asp page in which I call COM
component. This COM component accesses the SQL server through ADO.

  The error is:
  pubserver.titleupdate.Post error '80004005'
[Microsoft][ODBC SQL Server Driver][DBNMPNTW]ConnectionOpen (CreateFile()).

The SQLServer Security is configured as Integrated Securtiy. The user
account, admin, is assigned as privilege "sa" using SQL Server Security
Manager.
The SQLServer sits in different machine from the IIS. The SQLServer used
Named Pipe protocol.


<%
Set obj = Server.CreateObject("pubserver.titleupdate")
strtitle = "BU1032"
amount = 1
strdsn = "tryjiangsu"
id="admin"
pwd="author"
'call the COM component
result = obj.Post(strtitle,amount,strdsn,id,pwd)
%>

Com component written in VB5:

    Public Function Post( ) As String
    On Error GoTo ErrorHandler
    ' obtain the ADO environment and connection
    Dim adoConn As New ADODB.Connection
    Dim varRows As Variant

    adoConn.ConnectionString = "driver={SQL
Server};server=140.184.132.199;uid=admin;pwd=author;database=pubs"
    adoConn.ConnectionTimeout = 60
    adoConn.Open

    ' update the price
    Dim strSQL As String
strSQL = "UPDATE titles SET price = price + " + Str$(amount) + " WHERE
title_id ='" + title + "'"
    adoConn.Execute strSQL, varRows
  ...

If I use the Standard Security of SQL Server and user ID as "sa", password
as "",   everything is fine.

Thanks,
 Yie Wang

 
 
 

How to connect to SQL Server through ADO (SOL Server uses Integrated Security)

Post by Steve Robinso » Tue, 08 Sep 1998 04:00:00


Yie,

The reason could be that the IIS server is using the anonymous logon to try
and gain access to the sql through integrated security.  What you need to do
is set the anonymous login to use an account which can login to SQL Server
such as Admin (Just for test purposes).  Then  once this is working set up
an account with just the right access so not to leave your system open to
attack

Steve Robinson
SQLServer MVP



>Hi, everyboday!  Please help me!

>  I  have the following error when I run the asp page in which I call COM
>component. This COM component accesses the SQL server through ADO.

>  The error is:
>  pubserver.titleupdate.Post error '80004005'
>[Microsoft][ODBC SQL Server Driver][DBNMPNTW]ConnectionOpen (CreateFile()).

>The SQLServer Security is configured as Integrated Securtiy. The user
>account, admin, is assigned as privilege "sa" using SQL Server Security
>Manager.
>The SQLServer sits in different machine from the IIS. The SQLServer used
>Named Pipe protocol.


><%
>Set obj = Server.CreateObject("pubserver.titleupdate")
>strtitle = "BU1032"
>amount = 1
>strdsn = "tryjiangsu"
>id="admin"
>pwd="author"
>'call the COM component
>result = obj.Post(strtitle,amount,strdsn,id,pwd)
>%>

>Com component written in VB5:

>    Public Function Post( ) As String
>    On Error GoTo ErrorHandler
>    ' obtain the ADO environment and connection
>    Dim adoConn As New ADODB.Connection
>    Dim varRows As Variant

>    adoConn.ConnectionString = "driver={SQL
>Server};server=140.184.132.199;uid=admin;pwd=author;database=pubs"
>    adoConn.ConnectionTimeout = 60
>    adoConn.Open

>    ' update the price
>    Dim strSQL As String
>strSQL = "UPDATE titles SET price = price + " + Str$(amount) + " WHERE
>title_id ='" + title + "'"
>    adoConn.Execute strSQL, varRows
>  ...

>If I use the Standard Security of SQL Server and user ID as "sa", password
>as "",   everything is fine.

>Thanks,
> Yie Wang


 
 
 

1. How to connect to SQL Server through ADO (SOL Server uses Integrated Security)

Hi, everyboday!  Please help me!

  I  have the following error when I run the asp page in which I call COM
component. This COM component accesses the SQL server through ADO.

  The error is:
  pubserver.titleupdate.Post error '80004005'
[Microsoft][ODBC SQL Server Driver][DBNMPNTW]ConnectionOpen (CreateFile()).

The SQLServer Security is configured as Integrated Securtiy. The user
account, admin, is assigned as privilege "sa" using SQL Server Security
Manager.
The SQLServer sits in different machine from the IIS. The SQLServer used
Named Pipe protocol.


<%
Set obj = Server.CreateObject("pubserver.titleupdate")
strtitle = "BU1032"
amount = 1
strdsn = "tryjiangsu"
id="admin"
pwd="author"
'call the COM component
result = obj.Post(strtitle,amount,strdsn,id,pwd)
%>

Com component written in VB5:

    Public Function Post( ) As String
    On Error GoTo ErrorHandler
    ' obtain the ADO environment and connection
    Dim adoConn As New ADODB.Connection
    Dim varRows As Variant

    adoConn.ConnectionString = "driver={SQL
Server};server=140.184.132.199;uid=admin;pwd=author;database=pubs"
    adoConn.ConnectionTimeout = 60
    adoConn.Open

    ' update the price
    Dim strSQL As String
strSQL = "UPDATE titles SET price = price + " + Str$(amount) + " WHERE
title_id ='" + title + "'"
    adoConn.Execute strSQL, varRows
  ...

 If I use the Standard Security of SQL Server and user ID as "sa", password
as "",   everything is fine.

2. lost password for script files

3. ADO connection to SQL Server 7.0 using integrated security

4. When will there be a new msxml?

5. connecting to a remote server using vb+sql server using ADO

6. "Syntax error" message appearing without cause?

7. Help, Please : Changing Color of DBGrid Component

8. ADO and integrated security with SQL server

9. How to integrate Access application security with a SQL Server security

10. XMLBulkLoad Works with integrated security, fails with SQL Server security

11. COM+ and SQL Server; COM+, SQL Server, and Integrated Security; Integrated Security [Solved :-)]