Similar Threads:
1.Problem connecting to SQL Server from ASP on separate server (ASP.NET works ok)
Firstly, apologies for the long post, but I though it best to outline
everything I've done rather then waste anyone's time.
I have a web app that uses both ASP and ASP.Net with a SQL server 2000
backend. I was running IIS & SQL server on the same box and recently
decided to move SQL server to a separate machine. In the example
below, my IIS server is called 'TREVOR' and my SQL server is called
'RALPH' - both are running Win2K with SP5.
Getting ODBC connectivity to work has caused no end of problems. After
a lot of mucking around I have been able to get requests from ASP.Net
to connect OK, but requests from ASP stubbornly refuse to connect.
For simplicity, I decided to use the 'ASPNET' user name for both
ASP.Net and ASP ODBC requests. I have created a ASPNET user on both
TREVOR and RALPH and synchronised the password to 'myPassword'.
I have set SQL Server Authentication to be windows only.
Under the SQL Server login properties, the user RALPH\ASPNET appears
as a 'Windows User' has been granted access to the default database
'myDB'. Within this database, I have created a roll called 'IIS' with
various permissions to tables within the database. I have added the
user 'ASPNET' to the roll 'IIS'.
To work out what was going on, I configured SQL server to log all
login attempts to the Application log.
1. Steps used to get ASP.Net working:
1a) edited the machine.config file to include:
<processModel
userName="ASPNET"
password="myPassword"
/>
1b) modified the ODBC connection string to:
Dim sConn As String = "data source=RALPH;initial
catalog=myDB;integrated security=SSPI;persist security
info=False;workstation id=TREVOR;packet size=4096"
Dim myConnection As SqlConnection = New SqlConnection(sConn)
Dim myCommand As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM
myTable", myConnection)
1c) noted that access from ASP.Net are logged successfully in the
Application log as:
18453 : Login succeeded for user 'RALPH\ASPNET'. Connection: Trusted.
Ok, all well and good so far. However .
2. To setup ASP to connect to a remote SQL server I have:
2a) Under 'Computer Management (local)' on TREVOR, drilled down to
'Services and Applications' >> 'Internet Information Services' >>
'myWebSite' and right clicked to select properties. Under the
'Directory Services' tab, selected the 'Edit' Anonymous and
Authentication control button and checked 'Anonymous Access'.
Selecting the 'Edit' button I have added the username 'RALPH\ASPNET'
and entered the password 'myPassword' (the option 'Allow IIS to
Control Passwords' is unchecked). Note, I have also experimented
unsuccessfully with the usernames 'TREVOR\ASPNET' and 'ASPNET'
After changing the user name IIS should be operating under, I have
shelled to DOS and run the command 'IISRESET' to ensure it reloads.
2b) Setup an ASP test page with:
<<% @ LANGUAGE = VBScript >>
<
<
<<>>ODBC Connectivity tes<>>
<<>>
<<%
sConn = "Driver={SQL Server};Server=RALPH;Database=myDB;UID=
RALPH\ASPNET;PWD=myPassword;"
dim oConn
Set oConn= Server.CreateObject("ADODB.Connection")
oConn.open sConn
Response.Write("Open Connection<")
>>
<
This page throws the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'RALPH\ASPNET'. Reason: Not associated with a trusted SQL Server
connection.
Under the application log the attempt is logged as:
18452 : Login failed for user 'RALPH\ASPNET'. Reason: Not associated
with a trusted SQL Server connection.
So, my problem is
I cannot figure out why under ASP.Net the user 'RALPH\ASPNET'' is
treated as a 'Connection: Trusted', but under ASP I'm told the same
user is 'Not associated with a trusted SQL Server connection'. Can
anyone help?
Also,
Isn't is a bit crap that I have to have the password for the ASPNET
user lying around in plain text in the machine.config and in my
test.asp page? Is there an alternative?
Thanks,
Stephen
2.Can't connect to remote SQL database from localhost ASP.NET ap
3.Can't connect to remote SQL database from localhost ASP.NET app
Hello,
Our company just broke out its single network into a LAN network behind an
ISA Server firewall and a production network. Our ASP.NET applications
running on localhost are not able to connect to the remote SQL Server
(residing in the production network, of course) under any
settings/connectionstring combination we have tried. We have tried using
impersonation on the site and TCP/IP connections, which we thought would
temporarily solve the problem, but no luck. Ideally, we want to use
connection strings with SQL authentication (not windows auth), TCP/IP, and we
do NOT want to have to use impersonation on the site. Every time our code
attempts to open a database connection under any of these configurations, we
always get the error "SQL Server does not exist or access denied". We are
able to connect to the remote SQL Server from our dev machines every other
way: from Query Analyzer, Windows applications, and even through an ADO
connection running through ASP (not asp.net) on localhost pages using a the
SQLOLEDB provider. Can someone point us in the right direction for solving
this frustrating problem?
Thanks in advance,
Barb
4.VS.Net 2005 can't connect to remote SQL Server instance
I'm having an issue with VS.Net 2005. I just installed it and can't
connect any remote SQL instance from the IDE. My project is set up to
reference a remote SQL 2000 DB. I can connect to the SQL DB from Enterprise
Manager and VS.Net 2003. Anyone else have this problem? Just another
note - the code just hangs when I get to the "cn.open" line.
chris hankey
5.SQL Server Enterprise Manager or other tool to connect to remote SQL DB
I am looking for a free tool to connect and manage a
remote SQL Server 2000 DB ... anyone?
6. Can't connect to remote SQL Server using VS.NET 2K3 Server Explore
7. Can't connect to remote SQL Server using VS.NET 2K3 Server Explorer
8. Service Manager ok but Enterprise Mgr cant connect