473,795 Members | 3,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection

Hi,

First sorry for my english I'm french.

I developped a web app that work good under XPDEVSERVER machine (iis5) and SqlServerDevelo pper Edition.

I get problem when I moved this app to an other web server (IIS5.0) win2000. Actualy, I only have problem to connect with the Database that she still hosted on the the XPDEVSERVER mahcine . I get this error msg when I ask a aspx page that is connected to the database:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection

Here is my connection string :

strConn = "data source=DEVSERVE R;Provider=SQLO LEDB; initial catalog=pickup; integrated security=SSPI;p ersist security info=False;work station id=DEVSERVER;pa cket size=4096"

I also tried to use a local Sql Server acount with pwd and i got the same error message.data source=DEVSERVE R;User ID=SqlUser;Pass word=SqlUserPwd

I also tried data source=DEVSERVE R\aspnet

* I haven't find any sample or solution that show how to connect ASPX page to a remote SQL Server that.
It is suppose to be an frequently used architeture no?
* I added the ASPNET user on the database.

Thanks for your help

as*******@hotma il.com
Frederik
Nov 18 '05 #1
2 2261
Salut Frederik,

If you're connecting to to a remote SQL server (via IP address), try this:

oSQLConn.Connec tionString = "Network Library=DBMSSOC N;" & _
"Data Source=xxx.xxx. xxx.xxx,1433;" & _
"Initial Catalog=mySQLSe rverDBName;" & _
"User ID=myUsername;" & _
"Password=myPas sword"
Where:
- "Network Library=DBMSSOC N" tells SqlConnection to use TCP/IP (KB Q238949)
- xxx.xxx.xxx.xxx is an IP address.
- 1433 is the default port number for SQL Server. (KB Q269882 and Q287932)
- You can also add "Encrypt=ye s" for encryption

There are other connection strings here:

http://www.able-consulting.com/dotne...anagedProvider

See also:

http://support.microsoft.com/default...b;en-us;316989

Ken
Toronto
"Frederik" <as*******@hotm ail.com> wrote in message
news:ep******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

First sorry for my english I'm french.

I developped a web app that work good under XPDEVSERVER machine (iis5) and
SqlServerDevelo pper Edition.

I get problem when I moved this app to an other web server (IIS5.0) win2000.
Actualy, I only have problem to connect with the Database that she still
hosted on the the XPDEVSERVER mahcine . I get this error msg when I ask a
aspx page that is connected to the database:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection

Here is my connection string :

strConn = "data source=DEVSERVE R;Provider=SQLO LEDB; initial
catalog=pickup; integrated security=SSPI;p ersist security
info=False;work station id=DEVSERVER;pa cket size=4096"

I also tried to use a local Sql Server acount with pwd and i got the same
error message.data source=DEVSERVE R;User ID=SqlUser;Pass word=SqlUserPwd

I also tried data source=DEVSERVE R\aspnet

* I haven't find any sample or solution that show how to connect ASPX page
to a remote SQL Server that.
It is suppose to be an frequently used architeture no?
* I added the ASPNET user on the database.

Thanks for your help

as*******@hotma il.com
Frederik
Nov 18 '05 #2
I believe that the reason for the problem in the first place is the
"integrated security=SSPI" in the connection string. This tells SQL to use
domain credentials to connect you to the database; it ignores any user and
password settings you pass. I would hazard to guess that your web box and
your database are not in the same domain - in this case, SQL can't get the
credentials and you get the null user message. At least this is when I've
seen it.

Jeff
"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:Ob******** ******@TK2MSFTN GP10.phx.gbl...
Salut Frederik,

If you're connecting to to a remote SQL server (via IP address), try this:

oSQLConn.Connec tionString = "Network Library=DBMSSOC N;" & _
"Data Source=xxx.xxx. xxx.xxx,1433;" & _
"Initial Catalog=mySQLSe rverDBName;" & _
"User ID=myUsername;" & _
"Password=myPas sword"
Where:
- "Network Library=DBMSSOC N" tells SqlConnection to use TCP/IP (KB Q238949) - xxx.xxx.xxx.xxx is an IP address.
- 1433 is the default port number for SQL Server. (KB Q269882 and Q287932) - You can also add "Encrypt=ye s" for encryption

There are other connection strings here:

http://www.able-consulting.com/dotne...anagedProvider
See also:

http://support.microsoft.com/default...b;en-us;316989

Ken
Toronto
"Frederik" <as*******@hotm ail.com> wrote in message
news:ep******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

First sorry for my english I'm french.

I developped a web app that work good under XPDEVSERVER machine (iis5) and
SqlServerDevelo pper Edition.

I get problem when I moved this app to an other web server (IIS5.0) win2000. Actualy, I only have problem to connect with the Database that she still
hosted on the the XPDEVSERVER mahcine . I get this error msg when I ask a
aspx page that is connected to the database:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection

Here is my connection string :

strConn = "data source=DEVSERVE R;Provider=SQLO LEDB; initial
catalog=pickup; integrated security=SSPI;p ersist security
info=False;work station id=DEVSERVER;pa cket size=4096"

I also tried to use a local Sql Server acount with pwd and i got the same
error message.data source=DEVSERVE R;User ID=SqlUser;Pass word=SqlUserPwd

I also tried data source=DEVSERVE R\aspnet

* I haven't find any sample or solution that show how to connect ASPX page
to a remote SQL Server that.
It is suppose to be an frequently used architeture no?
* I added the ASPNET user on the database.

Thanks for your help

as*******@hotma il.com
Frederik

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14635
by: TBone | last post by:
Anyone, I have a user "john" whose machine is part of the "job" domain. He is trying to establish an odbc connection to an MS SQL 2000 server on the "school" domain. He uses Windows authentication to establish the odbc connection however it gives the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." I am guessing that the odbc connection is trying to pass the credentials of job\john...
1
2722
by: Mark | last post by:
We are using impersonation so that a user on our domain will login into our SQL Server using their own domain login and/or associated domain groups. To do this, we've added: <authentication mode="Windows" /> <identity impersonate="true"/> to our web.config file. In IIS, annonymous access is unchecked, digest authentication is unchecked, basic authentication is unchecked, and Integrated Windows Authentication is checked.
4
7227
by: rrober07 | last post by:
Hello, My Setup is I have a Web Server machine(Devweb01), Database SQL Machine(Devsql01), a Client Machine(local machine) I have configured the SQL machine as follows: 1) Added local Aspnet user account (with same password as aspnet user on IIS (Devweb01)) 2) edited local machine.config file <ProcessModel> Password attribute to same password (both on IIS and SQL Machine) 3) SQL Server security is Sql Server and Windows
3
1992
by: Nicola Marchiori | last post by:
Hi I need some help. I am developing a Web App in one PC running IIS. I am trying to connect to to MSDE on another PC, but it's not working. This is the message i got Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
1
2049
by: jerminator | last post by:
Ok I need some help. Up until Tuesday my application was working fine. It is an asp.net application written in VB. It is very data heavy and makes multiple calls to a database. The application itself sits on an IIS6.0 server. And the database is on an SQL2000 server with SP 3a. On Tuesday we started getting an error when we tried to call up the application. It said: Login failed for user '(null)'. Reason: Not associated with a trusted...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.