Showing posts with label helloi. Show all posts
Showing posts with label helloi. Show all posts

Monday, March 26, 2012

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

Hello:
I've just upgraded Windows 2000 server to Windows server 2003, and after
this I cannot get to the SQL server Enterprise manager, I'm getting error
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection"
I've found many articles about it, but they are all about problems with ASP
or ASP.Net. I don't have a problem with ASP.Net, my Intranet application is
running OK.
I still can get in using SQL server connection if I change the registration
properties, but if I use Trusted connections I get this error. And I need to
use trusted connections.
I would appreciate any help very much.
Thank you,
Peter Afonin"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> I've just upgraded Windows 2000 server to Windows server 2003, and after
> this I cannot get to the SQL server Enterprise manager, I'm getting error
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection"
> I've found many articles about it, but they are all about problems with
ASP
> or ASP.Net. I don't have a problem with ASP.Net, my Intranet application
is
> running OK.
> I still can get in using SQL server connection if I change the
registration
> properties, but if I use Trusted connections I get this error. And I need
to
> use trusted connections.
If you enable auditing on both the server and SQL Server, do you see any
failed login attempts? If so, which account is being used?
Steve|||"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...

> I've just upgraded Windows 2000 server to Windows server 2003, and after
> this I cannot get to the SQL server Enterprise manager, I'm getting error
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection"
> I've found many articles about it, but they are all about problems with
ASP
> or ASP.Net. I don't have a problem with ASP.Net, my Intranet application
is
> running OK.
> I still can get in using SQL server connection if I change the
registration
> properties, but if I use Trusted connections I get this error. And I need
to
> use trusted connections.
Moments after I posted the last message, I found this link which may be of
value to you:
How to troubleshoot connectivity issues in SQL Server 2000
http://www.support.microsoft.com/?id=827422
Steve|||Peter,
CAUSE
This error occurs because the SQL Server is configured to use "Windows only"
authentication.
RESOLUTION
On the SQL Server Security tab, configure SQL Server to use "SQL Server and
Windows" authentication.
Russell Fields
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> Hello:
> I've just upgraded Windows 2000 server to Windows server 2003, and after
> this I cannot get to the SQL server Enterprise manager, I'm getting error
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection"
> I've found many articles about it, but they are all about problems with
ASP
> or ASP.Net. I don't have a problem with ASP.Net, my Intranet application
is
> running OK.
> I still can get in using SQL server connection if I change the
registration
> properties, but if I use Trusted connections I get this error. And I need
to
> use trusted connections.
> I would appreciate any help very much.
> Thank you,
> --
> Peter Afonin
>|||Thank you, but it's configured this way.
Peter
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:O4mPpDUMEHA.624@.TK2MSFTNGP11.phx.gbl...
> Peter,
> CAUSE
> This error occurs because the SQL Server is configured to use "Windows
only"
> authentication.
> RESOLUTION
> On the SQL Server Security tab, configure SQL Server to use "SQL Server
and
> Windows" authentication.
> Russell Fields
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
error[vbcol=seagreen]
SQL[vbcol=seagreen]
> ASP
> is
> registration
need[vbcol=seagreen]
> to
>|||Thank you, Steve.
I'm working on it, buy now I even cannot get in with my administrative (sa)
account. I don't know what's wrong.
Peter
"Steve Thompson" <SteveThompson@.nomail.please> wrote in message
news:uD1X1CUMEHA.3596@.tk2msftngp13.phx.gbl...
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
>
error[vbcol=seagreen]
SQL[vbcol=seagreen]
> ASP
> is
> registration
need[vbcol=seagreen]
> to
> Moments after I posted the last message, I found this link which may be of
> value to you:
> How to troubleshoot connectivity issues in SQL Server 2000
> http://www.support.microsoft.com/?id=827422
> Steve
>|||By chance, did you change the security mode and not restart MSSQLServer
service?
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:OVxnWVUMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> Thank you, Steve.
> I'm working on it, buy now I even cannot get in with my administrative
(sa)
> account. I don't know what's wrong.
> Peter
> "Steve Thompson" <SteveThompson@.nomail.please> wrote in message
> news:uD1X1CUMEHA.3596@.tk2msftngp13.phx.gbl...
after[vbcol=seagreen]
> error
> SQL
with[vbcol=seagreen]
application[vbcol=seagreen]
> need
of[vbcol=seagreen]
>|||Peter,
Do you get the same error when logging in as 'sa'? If so, that is telling
you that the server is not accepting standard SQL logins, no matter what the
settings seems to be.
Do you have a domain account with sysadmin rights that you can login with?
If so, try that one.
During the upgrade of your server, did you lose any local Windows accounts?
Domain accounts? Look at article:
http://support.microsoft.com/defaul...kb;en-us;307002
Russell Fields
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:OVxnWVUMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> Thank you, Steve.
> I'm working on it, buy now I even cannot get in with my administrative
(sa)
> account. I don't know what's wrong.
> Peter
> "Steve Thompson" <SteveThompson@.nomail.please> wrote in message
> news:uD1X1CUMEHA.3596@.tk2msftngp13.phx.gbl...
after[vbcol=seagreen]
> error
> SQL
with[vbcol=seagreen]
application[vbcol=seagreen]
> need
of[vbcol=seagreen]
>|||OK. The (null) probably suggests the comment in my other post. (Unless
'sa' is returning a similar message.)
IF in the unlikely event that your registry is messed up:
http://support.microsoft.com/defaul...kb;en-us;285097
Russell Fields
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uNK2oUUMEHA.3216@.TK2MSFTNGP12.phx.gbl...
> Thank you, but it's configured this way.
> Peter
> "Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
> news:O4mPpDUMEHA.624@.TK2MSFTNGP11.phx.gbl...
> only"
> and
after[vbcol=seagreen]
> error
> SQL
with[vbcol=seagreen]
application[vbcol=seagreen]
> need
>|||I did restart it, thanks.
Peter
"Steve Thompson" <SteveThompson@.nomail.please> wrote in message
news:e1RnoaUMEHA.1556@.TK2MSFTNGP10.phx.gbl...
> By chance, did you change the security mode and not restart MSSQLServer
> service?
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:OVxnWVUMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> (sa)
> after
trusted[vbcol=seagreen]
> with
> application
be[vbcol=seagreen]
> of
>sql

Monday, March 12, 2012

login faild for user

Hello
I wrote a program on my computer it has a SQL database. It works on my computer but when I upload it on the internet it makes an error.
Login failed for user 'webmaster'
In my control panel I add new MS SQL SERVER database with the name=kelec, username = xx and password = xxxx
I think the problem is in my connectionstring what is the correct connectionstring for my connection.

Please help me
Best regards
KocholHi
I searched the MSDN for this problem and I found this.
I add username and password but I'm getting in new error.
Login failed for user 'NT …/NETWORK'

By default, ASP.NET applications run in the context of the local user called ASPNET in Windows 2000 and Windows XP or NETWORK SERVICE in Windows Server 2003. These user accounts have limited permissions. However, the ASPNET or NETWORK SERVICE user is local to the Web server computer and is therefore not recognized as a user on remote computers. To get around this limitation, you can have your application run in the context of a Windows domain user that is recognized on both the Web server computer and on the SQL Server computer.
Mapping your application process to a Windows domain user requires that you configure the following processes:
?The Web server computer You must be sure that the Windows domain user you specify has sufficient privileges (but no more) to run a Web application.
?Your application You need to configure the Web.config file to specify that ASP.NET use integrated security, which allows ASP.NET to recognized the mapped user name.
Note For information on the machine.config and Web.config files, see ASP.NET Configuration.
?Connection string When you create connection strings for connection objects in your application, you need to specify that they will use integrated security.
?SQL Server You need to add the specified domain user as a SQL Server login user.
Configuring Users on the Web Server Computer
To set user permissions for the Windows domain user
?Using Windows administrative tools on the Web server computer, make sure that the mapped Windows domain user has necessary privileges. For details, see ASP.NET Required Access Control Lists (ACLs).
Mapping to the Windows User and Enabling Impersonation
After establishing the correct permissions for the ASPNET or NETWORK SERVICE user account and for the user to map to, you configure the application to impersonate that user.
To configure your Web application for integrated security
?Open the Web.config file for your application and add the following elements:
?<authentication mode="Windows" />
<identity impersonate="true" userName="domain\username" password="password"/>
The <authentication> element might already be there.
Note Elements in Web.config are case sensitive.
Using Windows Security in the Connection String
Finally, when you create connection strings for database access, configure them to use Windows integrated security.
To use Windows security in the connection string
?When you create a connection string for your application, do not include a user name and password. Instead, set the connection string's Integrated Security attribute to SSPI.
The following example shows a connection string that includes the appropriate attributes:
data source=myserver;initial catalog=northwind;Integrated Security=SSPI
To configure SQL Server for integrated security
1.From the Windows Start menu, choose Microsoft SQL Server, and then choose Enterprise Manager.
2.Open the node for the server and expand the node for the database you want to give users permissions for.
3.Right-click the Users node and choose New Database User.
4.In the Database User Properties dialog box, enter domain\username in the Login name box, and then click OK.|||I assume you are using ASP.NET since you are in this forum. Try this:


Dim dbconn As New OleDbConnection
Dim strServer As String = "server" <-- your server name
Dim strDbName As String = "dataBaseName" <-- your DB name
Dim strUId As String = "xx"
Dim strPwd As String = "xxxx"

dbconn.ConnectionString = "PROVIDER=SQLOLEDB;" & _
"DATA Source=" & strServer & ";" & _
"Initial Catalog=" & strDbName & ";" & _
"User ID=" & strUId & ";Password=" & strPwd

Good luck!
-Gabian-