Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Monday, March 26, 2012

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

Hi guys,

I have a problem:

I have a created a vb.net app.

From this vb.net App (in server A) I connect to the SQL server SP4 (in serverA) and to a SQLServer 2000 SP4 in another server (server B).
All connection are with trusted_connection = true. Server A and B are in a domain.

After pressed a button, (when I run the button I am logged as a domain administrator) some store procedures and table are created in SQL server A and B.

During this phase everything is OK, I mean tables and store procs are installed correctly, and Linked server are installed.

The problem is that:at the end of this job a store aprocedure (in server B) is called form which has a sql statement (SQL select ...inner join from table in different sql server A,B),
the vb.net app show an error:

"System.Data.SQLClient.SqlExcemption: Login failed for user '(null)'. Reason: Not associated with a trusted SQL server connection"

Linked server is:

Local Login: domain\administrator
Impersonate: true
RMUser and Pw are null
Selected: Be made using the login's current security context

SQL server is win + SQL auth mode.

and account: System Account

Do you know how to solve the problem.

I tried to modify option in Linked server but is the same.

I replaced the conn string in vb.net with user and pass and everything work.
So, it looks like that using windows account credential used are lost.

Any help will be very appreciated

For .NET related questions, please see the Data Access forum in the .NET group.

Login failed for user '(null)'. Reason: Not associated with a trus

I am new to SQL Server Reporting Services 2005 and have created a new very
simple report. When I run the report directly on the report server it works
fine. If I try and run the report from my laptop I get the error
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I have set up the data source to use a trusted connection and my id has full
rights on the the database where the data resides. The Report server is
hosted on a SQL Server 2005 database and the data in the report is on a SQL
2000 named instance.
I am probably missing something in the setup, but don't know what. Any help
from anyone would be appreciated.does your SQL Server is on another server than the RS server himself?
(have you 2 servers: 1 with RS + IIS and the second with SQL Server himself)
If yes, then you suffer a Kerberos issue.
you have to setup Kerberos to allow your IIS Server to delegate the user.
Read this article:
http://support.microsoft.com/kb/215383/en-us
"gert" <gert@.discussions.microsoft.com> wrote in message
news:E981B1AB-6D2A-4751-8C0D-140B033CA1FA@.microsoft.com...
>I am new to SQL Server Reporting Services 2005 and have created a new very
> simple report. When I run the report directly on the report server it
> works
> fine. If I try and run the report from my laptop I get the error
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I have set up the data source to use a trusted connection and my id has
> full
> rights on the the database where the data resides. The Report server is
> hosted on a SQL Server 2005 database and the data in the report is on a
> SQL
> 2000 named instance.
> I am probably missing something in the setup, but don't know what. Any
> help
> from anyone would be appreciated.

Friday, March 23, 2012

login failed for 'user' (Application Role)

I've created a database in SQL Express and I have a Windows form attempting to connect to it through SQL Authentication. Connection string:

private string connString = @."Data Source=.\sqlexpress;Initial Catalog=SQLTestDatabase;User ID=SearchAppRole; Password=password;";

The role I have added to the database is an Application Role. It has been added to the Database permissions with Grant checked for "Select" and "Authenticate".

If I test this with query analyzer, it returns expected results (if I remove Grant from 'Select', it fails)

sp_setapprole 'SearchAppRole', 'password'

select * from recipe

If I edit my connection string (for testing purposes) to use the sa account, the application can connect and run the Select statement:

private string connString = @."Data Source=.\sqlexpress;Initial Catalog=SQLTestDatabase;User ID=sa; Password=sa_password;";

However, I cannot get the application to successfully logon and run the select statement when using the user id and password of the Application Role. I get error:

System.Data.SqlClient.SqlException: Login failed for user 'SearchAppRole'. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj

I can't find much information on Application Role...I just want one basic permission for the application as a whole. Any help is appreciated. Thanks.

You will first have to connect with a valid user on the database to set the application role. The user can be a dummy user having no access to the actual stored objects. But for using the command you will have to first open a connection to the database.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||Ok. I'm sure this works, and I think I found an example of it here on these forums. However, I decided to just add a User to the database and work with that. I'm not sure that I really need to use Application Role and I don't know why it isn't more straightforward. Thanks.sql

Login failed for user <servername>\<aspnet> error!

Hi all..

I really really need some help here. I have created a login application which is using samples from Microsoft's persistent cookie logon form using Forms authentication.

I am using Windows XP Pro, Visual Web Developer 2005 and SQL Server Enterprise Edition, IIS version 5.

Now my problem is that, when I was doing this login in the the local computer, everything works very fine. I am able to log in to my application thru the login sample that I had mentioned earlier. But when I upload it into the test server, it gives me this error:

"Login failed for user <servername>\<aspnet>"

I have tried googling around but to no avail. I have tried all sorts of means to get my application working as soon as possible because my company needs to upload them into production.

Hopefully needs to get some pointers here..

Thank you in advance..Hi all..

I really really need some help here. I have created a login application which is using samples from Microsoft's How To Implement Forms-Based Authentication in Your ASP.NET Application by Using Visual Basic .NET. It is using Forms authentication.

I am using Windows XP Pro, Visual Web Developer 2005 and SQL Server Enterprise Edition, IIS version 5.

Now my problem is that, when I was doing this login in the the local computer, everything works very fine. I am able to log in to my application thru the login sample that I had mentioned earlier. But when I upload it into the test server, it gives me this error:

"Login failed for user <servername>\<aspnet>"

I have tried googling around but to no avail. I have tried all sorts of means to get my application working as soon as possible because my company needs to upload them into production.

Hopefully needs to get some pointers here..

Thank you in advance..

Monday, March 19, 2012

login failed

Hi

I use visual basic 2005 express and wants to connect to a sql server 2005 express database . Im a newbie and has created a small database called test on my computer and now i just want to see if i can connect to it. My connection string is:

con.ConnectionString = "server=ACER\Sqlexpress;database=test;trusted_connection=true"

And when i run the app. and it get to the con.open() command the programs gives me this error

Cannot open database "test" requested by the login. The login failed.
Login failed for user 'ACER\Dan'

Acer is the name of my computer and my user name is Dan. Im the administrator of the computer and there is no password requered to log on.

Can anybody see where it is wrong?

You are admin on your PC, but your user id does not exist in a SQL Server and it does not know anything about it. This is why it fails. Integrated security for SQL Server does not mean that SQL Server automatically accepts all the users from the PC. It means that authintication is integrated with the Windows. To resolve this issue, you need to add your user id 'ACER\Dan' to the list of the users for your SQL Server database and then grant some permissions. Lext links show how to to do this

http://support.microsoft.com/kb/325003/en-us#XSLTH4213121122120121120120

http://support.microsoft.com/kb/240872/en-us

|||

Hi,

make sure that the database test exists on the instances SQLExpress. As the administrator you should be allowed to access the server and its databases, though you are in the role of the system administrators. (if this is the local system you are working on)


HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Login failed

I have VS2005 Beta 2

I created a very simple Web Site that has a Login page and a Default Page

I installed MSDE so that I can use a SQL 2000 database

I ran C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe
to create a database in the MSSQLSERVER for user info.

My Web.config file looks like:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=myDataBase;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="false">
<assemblies>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<authorization>
<deny users="?"></deny>
</authorization>
<authentication mode="Forms"/>
</system.web>
</configuration>


I have a Global.asax file containing:

void Application_Start(Object sender, EventArgs e) {
// always create bob and alice as users if they are not present
// so you can login and we can avoid dealing with admin
//
MembershipCreateStatus status;
if (Membership.FindUsersByName("bob").Count == 0)
Membership.CreateUser("bob", "pass@.word1", "bob@.wingtip.com", "no question", "no answer", true, out status);
if (Membership.FindUsersByName("alice").Count == 0)
Membership.CreateUser("alice", "pass@.word1", "alice@.wingtip.com", "no question", "no answer", true, out status);
}

When open the web site from the File System in VS2005 everything runs fine.

When I copy the Web site to a virtual directory set up in IIS and the open the web site using Local IIS in VS2005 I get:

Cannot open database "myDataBase" requested by the login. The login failed.
Login failed for user 'BARBARA\ASPNET'.


You use integrated security to connect to the database and when testing local in VS2005 it will use the currently logged on user running VS2005. Most likely that is your user account and it has access to the database.

The error message indicates you are trying to logon to the database with BARBARA\ASPNET user and that is the user setup to run the application in IIS. You could either change this to be another user that has access to the database needed, under directory security in IIS, or give the user BARBARA\ASPNET access to the database.|||Thanks for your reply - I don't have that much experience with this stuff -

Could you please tell me how I can go about giving BARBARA\ASPNET access to the database? I don't know about changing the user that is accessing the database in IIS. BARBARA is the name of the computer and ASPNET is the user that was created on the computer when all this stuff was loaded. Do I have to change the database server to use mixed security?

Is it a user that has to be set up for the server or for the database? In any case, I don't really know how to do this. Any direction would be appreciated.

thanks|||You might want to have a look at 3rd party tools to adminstrate MSDE.

You can do it directly in a query also.

exec sp_grantlogin 'BARBARA\ASPNET'
go
use myDataBase
go
exec sp_grantdbaccess 'BARBARA\ASPNET', 'ASPNET'
go
exec sp_addrolemember 'public', 'ASPNET'

This assumes that the group public has the proper permissions in the database. You could use dbo instead of public then the ASPNET user will be acting as database owner.

|||okay thank you very much - that gives me a direction

Login failed

I have VS2005 Beta 2

I created a very simple Web Site that has a Login page and a Default Page

I installed MSDE so that I can use a SQL 2000 database

I ranC:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe
to create a database in the MSSQLSERVER for user info.

My Web.config file looks like:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=myDataBase;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="false">
<assemblies>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<authorization>
<deny users="?"></deny>
</authorization>
<authentication mode="Forms"/>
</system.web>
</configuration>


I have a Global.asax file containing:

void Application_Start(Object sender, EventArgs e) {
// always create bob and alice as users if they are not present
// so you can login and we can avoid dealing with admin
//
MembershipCreateStatus status;
if (Membership.FindUsersByName("bob").Count == 0)
Membership.CreateUser("bob", "pass@.word1", "bob@.wingtip.com", "no question", "no answer", true, out status);
if (Membership.FindUsersByName("alice").Count == 0)
Membership.CreateUser("alice", "pass@.word1", "alice@.wingtip.com", "no question", "no answer", true, out status);
}

When open the web site from the File System in VS2005 everything runs fine.

When I copy the Web site to a virtual directory set up in IIS and the open the web site using Local IIS in VS2005 I get:

Cannot open database "myDataBase" requested by the login. The login failed.
Login failed for user 'BARBARA\ASPNET'.


You use integrated security to connect to the database and when testing local in VS2005 it will use the currently logged on user running VS2005. Most likely that is your user account and it has access to the database.

The error message indicates you are trying to logon to the database with BARBARA\ASPNET user and that is the user setup to run the application in IIS. You could either change this to be another user that has access to the database needed, under directory security in IIS, or give the user BARBARA\ASPNET access to the database.|||Thanks for your reply - I don't have that much experience with this stuff -

Could you please tell me how I can go about giving BARBARA\ASPNET access to the database? I don't know about changing the user that is accessing the database in IIS. BARBARA is the name of the computer and ASPNET is the user that was created on the computer when all this stuff was loaded. Do I have to change the database server to use mixed security?

Is it a user that has to be set up for the server or for the database? In any case, I don't really know how to do this. Any direction would be appreciated.

thanks|||You might want to have a look at 3rd party tools to adminstrate MSDE.

You can do it directly in a query also.

exec sp_grantlogin 'BARBARA\ASPNET'
go
use myDataBase
go
exec sp_grantdbaccess 'BARBARA\ASPNET', 'ASPNET'
go
exec sp_addrolemember 'public', 'ASPNET'

This assumes that the group public has the proper permissions in the database. You could use dbo instead of public then the ASPNET user will be acting as database owner.|||okay thank you very much - that gives me a direction

Monday, March 12, 2012

Login Error - Please Help

I have created a site using a login through the Asp.net Admin Website Tool. Through numerous tries of trying to get this to work, I am now receiving the following error "Login failed for user 'app1_lakeshore'." Can anyone help?

Here is my werbconfig file:

<?xmlversion="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

appSettings>

<

addkey="/LMCIntranet" />

</

appSettings>

<

connectionStrings>

<

removename="LocalSqlServer"/>

<

addname="LocalSqlServer"connectionString="Data Source=sqldev2.aurora.org;Initial Catalog=Lakeshore;Persist Security Info=True;User ID=app1_lakeshore"providerName="System.Data.SqlClient"/>

</

connectionStrings>

<

system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

Visual Basic options:

Set strict="true" to disallow all data type conversions

where data loss can occur.

Set explicit="true" to force declaration of all variables.

-->

<

authenticationmode="Forms" />

<

customErrorsmode="Off"/>

<

compilationdebug="true"strict="false"explicit="true"/>

<

pages>

<

namespaces>

<

clear/>

<

addnamespace="System"/>

<

addnamespace="System.Collections"/>

<

addnamespace="System.Collections.Specialized"/>

<

addnamespace="System.Configuration"/>

<

addnamespace="System.Text"/>

<

addnamespace="System.Text.RegularExpressions"/>

<

addnamespace="System.Web"/>

<

addnamespace="System.Web.Caching"/>

<

addnamespace="System.Web.SessionState"/>

<

addnamespace="System.Web.Security"/>

<

addnamespace="System.Web.Profile"/>

<

addnamespace="System.Web.UI"/>

<

addnamespace="System.Web.UI.WebControls"/>

<

addnamespace="System.Web.UI.WebControls.WebParts"/>

<

addnamespace="System.Web.UI.HtmlControls"/>

</

namespaces>

</

pages>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="vanessa.edwards@.aurora.org">

<

networkhost="localhost"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

It looks like you need to add the password to the connection string. Without the TrustedConnection parameter it will be using SQL Server authentication (authenticating against a SQL Server user ID). If you want to use the current Windows id you'll want to set TrustedConnection=true and omit username and password from the connection string.|||

I am still getting the same error - what am I doing wrong?

<

addname="LocalSqlServer"connectionString="Data Source=sqldev2.aurora.org;Initial Catalog=Lakeshore;Persist Security Info=True;User ID=app1_lakeshore;Password=need1004"providerName="System.Data.SqlClient"/>

</

connectionStrings>

Please HELP!!!!

|||

Hi,

I suggest you try to create a UDL file to test the connection to see if the username and password can work.

Here are the steps

1. Create a normal Text file.
2. Rename it to .udl extension.
3. Double click on that file and a Data Link Properties dialog box will be show.
4. Select the provider and data source, specify username and password, and click the Test Connection button for test.

Login difficulty

I have created a a web application on computer1 and I have now transferred it to computer2. I am trying to attach my database (db1) in VS but I get this error: "Cannot open user default database. Login failed for user: username1". However when I use Management Studio Express I am able to access db1. I'm a newbie on this.

If you are not using the Advanced version of Express uninstall the current one and install the Advanced because it comes with Management Studio that will help with the above problem. Hope this helps.

http://msdn.microsoft.com/vstudio/express/sql/download/

|||

By default, SQL Server is 'closed' to remote connections.

You will need to configure the server to allow remote connections. These sources will guide you.

Configuration -Configure SQL Server 2005 to allow remote connections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Configuration -Connect to SQL Express from "downlevel clients"
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx

Configuration -Connect to SQL Express and ‘Stay Connected’
http://betav.com/blog/billva/2006/06/getting_and_staying_connected.html

Configuration - Guideline for Connectivity Question Posting
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1

|||if you specified a non-exisiting database as the default database for the user or the user does not h ave access to his default database, then you probably will get this error message. So check if the has the appropiate permissions to access his default user database or change the default database using the GUI or using the TSQL command sp_defaultdb.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Login Confusion

Hi,

I am Just beginning to get to grips with SQL Server v 7 security on a stand
alone win 98 PC.

I have created a login which only has access to the pubs database and when I
try and connect to any other database (while using this login) I am
correctly told that I don't have access. However, Enterprise Manager does
not request a login and therefore the log in seems to grant full access to
every database.

How can I get Enterprise Manager to request a log in?

Thanks.Stevie D (Steve@.127.0.0.1) writes:
> I have created a login which only has access to the pubs database and
> when I try and connect to any other database (while using this login) I
> am correctly told that I don't have access. However, Enterprise Manager
> does not request a login and therefore the log in seems to grant full
> access to every database.
> How can I get Enterprise Manager to request a log in?

Right-click the server and select Edit Registration properties. There
is a checkbox for always being prompted.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland

This worked fine

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns960F305E4DBEYazorman@.127.0.0.1...
> Stevie D (Steve@.127.0.0.1) writes:
> > I have created a login which only has access to the pubs database and
> > when I try and connect to any other database (while using this login) I
> > am correctly told that I don't have access. However, Enterprise Manager
> > does not request a login and therefore the log in seems to grant full
> > access to every database.
> > How can I get Enterprise Manager to request a log in?
> Right-click the server and select Edit Registration properties. There
> is a checkbox for always being prompted.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp

Login box when starting Report Builder

I'm new in SSRS so hopefully this will be an easy question.

I want to create a report model based on a cube. I have created a data source for the cube. Now when I click on Report Builder I get a login box titled "Microsoft Report Server Login".

When I enter the local admin account and password I get:

No report server was found at http://crossdatabase/ReportServer

When I enter that URL in IE I get:

crossdatabase/ReportServer - /


zondag 16 september 2007 23:24 <ds> Crossdatabase

Microsoft SQL Server Reporting Services Version 9.00.1399.00 What am I doing wrong? I already found some explanation about adding the Report Builder role so in home I now have:

EditBUILTIN\AdministratorsContent Manager, Report Builder

Anyone got any ideas?
Thanks,Stijn Verrept.

Please review the link below and let us know if this fixes your issue.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1697246&SiteID=1

|||I won't have access to the machine till later on, but this post is about users not seeing the Report Builder button. I'm admin, I see the button but when I click it I get the login box.|||

I tried but still get the same login box after clicking on the Report Builder button.

This is the login box that I get:

http://www.caresolutions.be/login.jpg

|||

According to your log above, you are running SQL Server 2005 RTM (Version 9.00.1399.00 ). You need to apply Service Pack 2 which should get you to Version 9.00.3042.00 and may fix your problem.

|||

This indeed fixed my problem, I now have another one however, but I'll post this in a new thread. Thanks.