473,237 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

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 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
2 2236
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
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...
1
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...
4
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...
3
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...
1
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.