By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,612 Members | 1,632 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,612 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hi,

First sorry for my english I'm french.

I developped a web app that work good under XPDEVSERVER machine (iis5) and SqlServerDevelopper 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=DEVSERVER;Provider=SQLOLEDB; initial catalog=pickup;integrated security=SSPI;persist security info=False;workstation id=DEVSERVER;packet size=4096"

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

I also tried data source=DEVSERVER\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*******@hotmail.com
Frederik
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Salut Frederik,

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

oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
Where:
- "Network Library=DBMSSOCN" 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=yes" 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*******@hotmail.com> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Hi,

First sorry for my english I'm french.

I developped a web app that work good under XPDEVSERVER machine (iis5) and
SqlServerDevelopper 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=DEVSERVER;Provider=SQLOLEDB; initial
catalog=pickup;integrated security=SSPI;persist security
info=False;workstation id=DEVSERVER;packet size=4096"

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

I also tried data source=DEVSERVER\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*******@hotmail.com
Frederik
Nov 18 '05 #2

P: n/a
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**************@TK2MSFTNGP10.phx.gbl...
Salut Frederik,

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

oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
Where:
- "Network Library=DBMSSOCN" 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=yes" 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*******@hotmail.com> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Hi,

First sorry for my english I'm french.

I developped a web app that work good under XPDEVSERVER machine (iis5) and
SqlServerDevelopper 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=DEVSERVER;Provider=SQLOLEDB; initial
catalog=pickup;integrated security=SSPI;persist security
info=False;workstation id=DEVSERVER;packet size=4096"

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

I also tried data source=DEVSERVER\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*******@hotmail.com
Frederik

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.