i am using asp/vbscript to access an sql database residing on another server. i get the following error : ------------------------------------- Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/checkid_index.asp, line 25 ----------------------------------- given below is the code for checkid_index.asp ---------------------------------- dim conn,rs,strsql Set conn=Server.CreateObject("ADODB.Connection")
'Network Library and port 1433 ' conn.connectionstring = "Provider=sqloledb;Data Source=203.199.114.100,1433;Network Library=DBMSSOCN;Initial Catalog=reg_mumineen;User ID=jamea;Password=jamea"
'Trusted connection: conn.ConnectionString="Provider=SQLOLEDB; Data Source=203.199.114.100;Initial Catalog=reg_mumineen; User ID=jamea; Password=jamea; Integrated Security=SSPI;"
conn.open
error is on last line which is line 25 i have tried all ways possible but nothing works on my website although on localhost IIS 5, it works perfectly whichever string i use. connection is succefull and i can retrive data through stored procedures thereafter.
i have also used conn.open varstring where varstring is the connection string above.
only on website this does not work. please pls help.
This conversation is currently closed to new comments.
The 80004005 error message indicates that your data cannot be accessed. When your ASP attempts to access database located on remote machine, the problem stem from the fact that ASP is operating in the context of the IUSR_MACHINE account. On servers that are not primary or backup domain controllers, the IUSR_MACHINE account is a local account. Since this local account is not recognized on the remote machine, access is denied to the database.
The 2 possible workarounds for this problem are:
1. Change the Anonymous Logon account on the IIS server from IUSR_MACHINE to a domain account that is recognized by both machines and has sufficient permissions to the resource. In addition, be sure that this account has the log on locally user right on the IIS machine. Recall that the Anonymous Logon account is configured through Internet Service Manager.
2. Add a local account to the remote machine that exactly matches the username and password of the IUSR_MACHINE account on the IIS machine, and give this account access to the database.
Also note that: If IIS and SQL servers are in different domains, either a trust must be setup between the two domains or the IUSR_WEB account has to be added to the SQL domain.
A special license one-user license (per SQL Server) is necessary to allow unlimited Internet access.
If challenge authentication is enabled in IIS, it prevents logging onto remote SQL server. You will need to use basic authentication, or install SQL server on same server as IIS.
Public Sub SetConnection(ByVal ConnStr As String) Me.myConnection.ConnectionString = ConnStr End Sub
'********************************************
OPEN AND RUN YOUR QUERY:
'********************************************
Public Function RunQuery(ByVal InQuery As String) As Integer ClearError() Dim tempInteger As Integer = 0 myCommand.CommandText = InQuery Try If myCommand.Connection.State = ConnectionState.Closed Then myCommand.Connection.Open() myCommand.CommandTimeout =10000 End If
tempInteger = myCommand.ExecuteNonQuery() If myCommand.Connection.State = ConnectionState.Open Then myCommand.Connection.Close() End If Catch E As Exception If myCommand.Connection.State = ConnectionState.Open Then myCommand.Connection.Close() End If HandleError("DBCOM.RunQuery", InQuery, E.Message) Finally '(); End Try Return tempInteger End Function
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
sql server connection problem
residing on another server. i get the following error :
-------------------------------------
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/checkid_index.asp, line 25
-----------------------------------
given below is the code for checkid_index.asp
----------------------------------
dim conn,rs,strsql
Set conn=Server.CreateObject("ADODB.Connection")
'Standard
' Conn.connectionstring ="PROVIDER=SQLOLEDB;DATA SOURCE=203.199.114.100;UID=jamea;PWD=jamea;DATABASE=reg_mumineen"
' Conn.connectionstring="driver={SQL Server};server=203.199.114.100;uid=jamea;pwd=jamea;database=reg_mumineen"
'Network Library and port 1433
' conn.connectionstring = "Provider=sqloledb;Data Source=203.199.114.100,1433;Network Library=DBMSSOCN;Initial Catalog=reg_mumineen;User ID=jamea;Password=jamea"
'Trusted connection:
conn.ConnectionString="Provider=SQLOLEDB; Data Source=203.199.114.100;Initial Catalog=reg_mumineen; User ID=jamea; Password=jamea; Integrated Security=SSPI;"
conn.open
error is on last line which is line 25
i have tried all ways possible but nothing works on my website although on localhost IIS 5, it works perfectly whichever string i use. connection is succefull and i can retrive data through stored procedures thereafter.
i have also used
conn.open varstring
where varstring is the connection string above.
only on website this does not work.
please pls help.