Cannot Open Database Requested In Login 'ASPState'
Jan 6, 2006
I am getting the following error and cannot figure out why it does not work.
I know the USER is has access to the SQL Server Database and I have tried turning on
<identity impersonate="true" />
Nothing works. Any help would be great.
Cannot open database requested in login 'ASPState'. Login fails. Login failed for user 'DOMAINXXXBATWOW'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'ASPState'. Login fails. Login failed for user 'DOMAINXXXBATWOW'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: Cannot open database requested in login 'ASPState'. Login fails.
Login failed for user 'DOMAINXXXBATWOW'.]
System.Data.SqlClient.ConnectionPool.CreateConnection() +402
System.Data.SqlClient.ConnectionPool.UserCreateRequest() +147
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +384
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
System.Web.SessionState.SqlStateConnection..ctor(String sqlconnectionstring) +92
Hi, Im getting this error when attempting to retrieve data from an sql database.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'projectAllocations'. Login fails. Login failed for user 'sa'.
Source Error:
Line 13: objConn = New SqlConnection( "Server=LAB303-066NETSDK; Database=projectAllocations; User ID=sa;Password=mypassword") Line 14: objCmd = New SqlCommand("SELECT * FROM project_descriptions", objConn) Line 15: objConn.Open() Line 16: objRdr = objCmd.ExecuteReader() Line 17: While objRdr.Read()
Been looking through the forums for a solution to this problem.I already tried granting access through statements such as:exec sp_grantloginaccess N1'machineNameASPNET'But they don't seem to work.. i vaguely remember seeing somewhere a DOS command line statement that grants access to the ASPNET_WP and that fixed my problem before on another computer.. but this is a new computer and i forgot to write down the command.Can anyone help explain and propose a solution to my problem. Many thanxs.
I am using the MSDE to connect to my ASP.NET application. I get this error after clicking the login button of my login page. Anyone know why this would happen?
Thanks for any help,
Cannot open database requested in login 'DataSQL'. Login fails. Login failed for user 'serverASPNET'.
Hi I have asp.net2 app using SQLExpress which works fine in VS2005. When I compile it and try to run it from IIS on the same machine using the same sql server database with: connectionstring="server=.SQLEXPRESS;Database=abc.mdf;Trusted_Connection=yes"/> I get the following error. Cannot open database abc.mdf requested by login. The login failed. Login failed for user 'machinenameASPNET' Any help much appreciated
<add name ="ASPNETDBConnectionString1" connectionString ="Data Source= .SQLEXPRESS; Integrated Security = True; DataBase = ASPNETDB.MDF; User ID = MyWindowsUserName; Password = MyWindowsPassword; User Instance = False; Connect Timeout = 30" providerName ="System.Data.SqlClient"/>
I tried to research on the internet and i got a solution on changing the permissions for this database to enable user SystemName/ASPNET, but iam not able to access this ASPNETDB.MDF from SqlServer and if i go to server explorer in vs2005, i dint know where to chage the permissions.
Cannot open database "QuoteSystem" requested by the login. The login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Last time I recieved this error I had to add ASPNet, NTAuthority, and myWebSiteUsers USERS under the database properties-->permissions setting for the specific database I am trying to access with the website but this database(QuoteSystem) does not lists any of these objects so I can add them. Does anybody know what I have to do to fix this? I am using SQL Server 2005.
Please, can anyone tell me why I am getting the undermentioned error message when I develop my application as an IIS Site in Visual Web Developer 2005 Express ? I have already developed and successfully tested it as a 'FileSystem Web Site' .I am using SQLSErver Express 2005 edition and have which I have installed along with the Northwind database as per the download instructions. My IIS software is version 5.1 which I have checked and it is configured to allow Integrated Windows Authentication. the relevant code is (1) web.config file connection strings <connectionStrings> <add name="NorthwindConnectionString" connectionString="Data Source=.sqlexpress;Initial Catalog=Northwind;Integrated Security=True" providerName="System.Data.SqlClient"/> </connectionStrings>(2) the grid view control and sqldatasource <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" /> <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [CategoryID], [CategoryName], [Description] FROM [Categories]"> </asp:SqlDataSource>This is the full error message and details: Server Error in '/sqlservertest' Application.
Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'JERRY-3C9615BAAASPNET'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'JERRY-3C9615BAAASPNET'.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
Hi all, Iam getting this error System.Data.SqlClient.SqlException: Cannot open database "XYZ" requested by the login. The login failed.Login failed for user 'xyz-abcASPNET'. when trying to open the page.... http://localhost:1807/projectname/WebFormName.aspx as http://localhost/projectname/WebFormName.aspx Couldnt figure out the solution.Please help Soujanya
Hi, I just installed Visual web developper 2008 express with all options including SQL srvr express 2005!
This is from default iso image on the official website.
I create my first project and when I want to do ASP.NET configuration from web site menu, i got this error:
"Cannot open database "aspnetdb" requested by the login. The login failed."
I am just trying to learn here so i even did not create any dB or something, it is 1st time I run configuration to add security roles and users for testing!
I also un-installed all and re-installed, still the same...
Error!!! 1>Cannot open database "intranet" requested by the login. The login failed.Login failed for user 'RAGHAVEN-71AF9BASPNET'. Error!!! 2> An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) These both errors r coming simultaneously when start to debug only when i tried to retrive data from database , from past two days not able to work on database,plz help me in solving this ,i tried everything what i know and even on experts advice from recommended websites, forums and on google search..
I am getting the above error. On server1 I am running a dts package via a sql server job (sql server2005). This has been working perfectly for over a year. This package needs to access a database on server2. The database in question on server2 was recently restored from our produciton environment to refresh the data. Every since thsi time the job on server1 is failing with the above error.
Steps I have taken so far: droped the user from server2 and recreated it gave the user sysadmin rights on server 2 and server1
I'm using Visual Web Developer, .NET Framework 2.0, ASP.NET 20., IIS 5.1. on Windows XP Pro SP2.
I have assigned every possible user i can think of full permissions to the web folder, all of the subfolders, and the database files. This includes Administrator, Administrator Groups, ASPNET user, IUSR_Machine, Interner guest account, Network Group, Network Service Group, Power Users Group, Users.
I'm logged on as administrator.
When i run the web service from within VWD, i get this error.
Cannot open database "eBayTrader" requested by the login. The login failed. Login failed for user 'DHJC2R91ASPNET'.
Does anybody know how to resolve this problem ?
I have been working on it for days. I will gladly pay someone to work this out with me over the phone/email. I'll send you a check before we start.
I have created a new database within SQLServer Express 2005 and have an ASP page in IIS. Any time i attempt to access the database I get the following error:
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "testDB" requested by the login. The login failed.
The ODBC connection that I have created works fine if connecting to the same table (literally three sample fields with two records) in an Access database.
The database connection that I am using is:
Set DatabaseConnection = Server.CreateObject("ADODB.Connection") DatabaseConnection.Open "DSN=testDB;UID=EINSTEINAdministrator&pwd=password;DATABASE=testDB;APP=ASP Script" Set rs = Server.CreateObject("ADODB.recordset") SQLString = "SELECT * FROM testTable" rs.Open SQLString, DatabaseConnection if NOT rs.EOF then Response.Write(rs("testField1") & " - " & rs("testField2")) end if rs.Close DatabaseConnection.Close Set DatabaseConnection = Nothing
EINSTEIN is the name of the server, rs = Recordset. I have tried changing to just Administrator instead of machinenameAdministrator with no success. I have got SQL Server Management Studio Express CTP, and can log in fine to SQL Server using EINSTEINAdministrator.
I get that error.I'm sure you see this question alot, but i'm dumfounded by it. Problem is that i've taken the code directly off the live website, yes i've changed the connection string... Private _connStr As String = "Data Source=localhostSQLEXPRESS;Initial Catalog=EFM;User ID=*****;password=******;Trusted_Connection=true" and am using the database that was originally worked on... Only thing that has changed is my new computer.... had to reload everything... new VWD, new sql express, new sql servermanagement studio express... all semmingly working fine... ie i can see the database and edit it, i just cant connect to it through the localhost to test the program. Any Ideas? why does this error come up... how can i fix it? Thanks in advance Cannot open database "EFM" requested by the login. The login failed.Login failed for user 'GERTIEIBM USER'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database "EFM" requested by the login. The login failed.Login failed for user 'GERTIEIBM USER'.
Source Error:
Line 19: MyBase.New()Line 20: myConn = New SqlConnection(_connStr)Line 21: myConn.Open()Line 22: End SubLine 23:
Source File: C:Documents and SettingsIBM USERDesktopEntertainmentwwwrootApp_CodecDB.vb Line: 21
Hi, we are running a webapplication, using IIS6, Windows 2003 64 bit in classic Asp. In the asp pages we connect to our SQL server (SQL Server 2005 64bit,windows 2003 64 bit), mirrored on a third sql server (same software setup as the first sql server).
The mirroring is without witness.
This works perfectly but sometimes we get the following error :
Description: [Microsoft][SQL Native Client][SQL Server]Cannot open database "OBJECTS" requested by the login. The login failed.
In the logs of sql, we see that the offending connection does not go the principal but to the mirror. Which would cause the problem of course..
The name of the database varies, and there is no consistent error. Most of the time there are no problems (95%), but sometimes we get these errors.
Connection from the asp to sql is done using ADO, using following driver in the connectionstring :
Driver="{SQL Native Client}"
Does anyone have an idea what could be the problem ? We can of course increase timouts for the mirroring, but is this the solution ?
Hi, we are running a webapplication, using IIS6, Windows 2003 64 bit in classic Asp. In the ASP pages we connect to our SQL server (SQL Server 2005 64bit,windows 2003 64 bit), mirrored on a third sql server (same software /hardware setup as the first sql server).
The mirroring is without witness.
This works but sometimes we get the following ODBC error in our ASP application :
Description: [Microsoft][SQL Native Client][SQL Server]Cannot open database "OBJECTS" requested by the login. The login failed.
No error can be seen in the principal SQL error logs. But a failed authorization can be found on the mirror server.. And this of course this makes sense, as the connection does not go to the primary but to the secondary, which is acting as mirror. And therefore can not be accessed. The question is : why does the connection sometimes jumps in stead from the primary server, to the mirror server ? Nowhere in the code I give a secondary server as reference.
Most of the time there are no problems (97%), but sometimes we get these errors.
The moments that this error occures are random, as are the databases with which the error occurs.
The connection is made through ODBC in an ASP web application (IIS6) , simelar to :
Set oCn = Server.CreateObject("ADODB.Connection") oCn.CommandTimeout = 180 oCn.Open lconstring
where lconstring is a dsn param : e.g. "filedsn=c:datadsnmastercon.dsn" where the dsn file contains following info :
I tried the above without the DSN, so a dsnless connection string. Nothing changed. I tried following drivers :{SQL Native Client} and SQLNCLI Nothing changed
Does anyone have an idea what could be the problem ? We can of course increase timouts for the mirroring, but is this the solution ? Before we started using SQL 2005 and mirroring this problem did not occur. Greets Tom
Hi there i'm having a bit of trouble with my asp.net authorisations and was wondering if anyone would have any idea how I can solve it - as it's driving me nuts!.
On my local machine (I've MDSN) running with Web Matrix - my connection works fine.
However since i've uploaded it to my Hoster - Forms and DB - I get the error
Cannot open database requested in login 'TestDB'. Login fails. Login failed for user AUTHORITYNET SERVICE'.
Can anyone give me any pointers on where I should be going?
I've been told by my Hosting co. that the server should be set to localhost (as shown) but thats about it!
Hi I’m new in using “SqlClient� I have SQLSERVER 2000 on my computer and I made a Database named “TestDB�, and a code like this both Using VS.net :
// begin test Code /////////////////////////////////// string connectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog= TestDB;Data Source=HOSSEIN-COM;Workstation ID=HOSSEIN-COM"; string commandString = "Select * from Categories"; SqlDataAdapter DataAdapter = new SqlDataAdapter( commandString, connectionString); DataSet DataSet = new DataSet( ); DataAdapter.Fill(DataSet,"CategoryID"); Label1.Text= DataSet.Tables[0].Rows[0]["CategoryID"].ToString();
// end test code /////////////////////////////////////
And at browser I found this error when I Start Building the project:
“Cannot open database requested in login 'testdb'. Login fails. Login failed for user ‘(my coputer name / my name )’ “
Then I changed Catalog= TestDB to Catalog= Northwind and the table name to and available table name and it works , then I tried to create a table at northwind database but this error appeared : “SELECT permission denied on object 'testTB', database 'Northwind', owner 'dbo'� TestTB = my northwind table I guess there must be some security setting in creating databases and tables that I do not know , And when I tried to install quick start the database was not installed , I have XP and VS.net and SQLserver 2000 . please halp me as You always do ;) …
Hello, I am using Visual Web Developer 2005 Express Edition and I am following the book:"Beginning ASP.NET 2.0 E-commerce in C# . I am encountering a problem and I haven't got the slightest idea how to solve the problem. (If you have the book I got to p98) If I debug then I get the next error: cannot open database"..." requested by the login... In the book I had to make a GenericDataAccess.cs. What follows are snippets where the error occurs. public static DataTable ExecuteSelectCommand(DbCommand command) { DataTable table try { command.Connection.Open(); DbDataReader reader = command.ExecuteReader(); table = new DataTable(); table.Load(reader); reader.Close(); } catch (Exception ex) { Utilities.LogError(ex); throw ex; //this is where my error occurs when I debug it } finally { commandConnection.close(); } return table; } Ideas and sollutions are more than welcome :-)
I am using ASP to connect to an MS SQL database. The script connects to the database OK and I can retrieve recordset data and add new rows without a problem.
However, when I try to edit a recordset (using the recordset.update command), I get the following error:
Cannot open database requested in login 'andthen_development'. Login fails.
My first thought was that it must be a permissions problem, but that doesn't explain why I can view and add rows, but not edit. Any ideas?
i was using .net's internal server as a my web server(local)now i have changes it to IIS(local)but now i amgetting an error like Cannot open database "mydatabse" requested by the login. The login failed.Login failed for user 'SV2ASPNET' 'SV is my achine name ASPNET is a login in the directory in seccurity/logins in sql server management studio what can i do?
Hi, Despite there are many threads about this issue, I cannot find an answer for my problem. The next environment is in use: 1 server SBS2K3 with SQL2000/Sp3a, running Windows SharePoint Services. (IIS6) 1 server W2K3 SE with SQL2000/Sp3a, running webapplications (IIS6) 1 development-PC, running Visual Studio 2K3.
Webapplications, build with VS2K3 are hosted by IIS6 on w2K3-machine. Running IE from both SBS2K3 and dev-PC (via proxy - so the URL = http://www.xxx.nl) gives me the start(login)page, but when given in the credentials (checking a table on SQL2000/sp3a on W2K3-machine) I got the error: "Cannot open database rquested in etcetera.... Login failed for user <machinename>/IUSR_<machinename>. Why is that ? I have added this <machinename>/IUSR_<machinename> to Security/newLogins of the SQL2000/SP3A of W2K3-machine, but no avail..... What is wrong ? Helping advise is appreciated, Ger.
Hi there, I'm running IIS 7.0 on vista ultimate together with SQL Server 2005 Express. I have a DSN connection set up and I'm trying to connect to the database from an ASP script but i get this error: [SQL_Server]Cannot_open_database__Testing__requested_by_the_login._The_login_failed. "Testing" is the name of my database. I have granted ASPNET account permissions to the database, but still gives me the same error. Please help --Pheks
I'm running IIS 7.0 on vista ultimate together with SQL Server 2005 Express. I have a DSN connection set up and I'm trying to connect to the database from an ASP script but i get this error: [SQL_Server]Cannot_open_database__Testing__requested_by_the_login._The_login_failed.
"Testing" is the name of my database. I have granted ASPNET account permissions to the database, but still gives me the same error.
hi, so i have a new box and I'm trying to get my websites and SQL Server 2005 Standard Edition working on it, but the pages give me the following error when I try to load them: "Cannot Open Database "XXXX" requested by login. The login failed. Login failed for user 'xxx'" Everything seems exactly the same settings and user-wise from my old box to my new one, but nevertheless everything I've tried gives me the same error. I've tried creating new users in SQL Server and giving them appropriate permissions to my database. I've even tried just using the built in 'sa' account. Nothing seems to change the error, except when I give it the incorrect password then it just says 'login failed' This leads me to believe that i'm successfully logging into the SQL Server, but it doesn't want to give me access to the database I'm requesting access too. But "apparently" the account i'm using should have access to the database. If nothing else the 'sa' account should, but that didn't work either. I'm stumped. Any ideas?
I hope someone can help with my current issue as i have now spent the last 8 hours trying to solve it! Here goes...
I am currently moving all my websites from our in house set up to a FASTHOSTS dedicated server. Our in house set up consists of separate server for web and data and works well even with my recent foray into .Net sites.
I have just moved the most recent of my .Net sites (http://www.alfadealerads.co.uk/home.aspx) to the FASTHOSTS server and cannot get the site to connect to the database (this has also been installed on the FASTHOSTS server). One of the pages that connects to the DB is http://www.alfadealerads.co.uk/links.aspx, where i am getting the error..
System.Data.SqlClient.SqlException: Cannot open database requested in login 'MasseratiChauffeurDrive'. Login fails. Login failed for user 'lateral'.
This DB has been restored from back up from the original DB. I have recreated the user name on the new SQL server and added it to the new DB also. I am using a webconfig to connect to the DB, the exact same one that works on my current live server (http://www.maseratichauffeurdrive.com/home.aspx) only with the obvious change to the SQL server name.
The only difference i can see in the 2 setups is that the new one has both the webserver and the SQL server on the one machine and that machine uses domains.
My current in house setup does not use domains and as mentioned before web and date are 2 separate servers.
Can anyone help? Or even understand what the hell i have written? lol
Have just tried my sql server 2005 connected asp classic website on II7 for the first time and have gotten some errors. First off I have unchecked show friendly errors in IE and have enabled ASP to send error messages to the browser.
My error I get is when I execute a basic .asp page:
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "mydatabasename" requested by the login. The login failed. /index.asp, line 10 which is dbConnect.Open cstring
from this peice of code:
sub dbOpen() set dbConnect = Server.CreateObject("ADODB.Connection") cstring = "DSN=mysqldsn; Trusted Connection=yes" dbConnect.Open cstring end sub
I have gone into ODBC and have setup both a user dsn and file dsn that equals mysqldsn and points to my database (I know you only need to set up one DSN but I'm not sure which)
I also notice under mywebsite home panel there is a connection string option. Do I do anything with that?
I am getting the error: Cannot open database "aspnetdb" requested by the login. The login failed. When I browse to my ASP.NET 3.5 LINQ web application on the IIS 6.0 server on Server 2003. I imagine this is because while I granted SQL Server 2005 login and permissions to my database that the application stores its data in, I did NOT grant any rights to the service account the IIS Application Pool uses for its identity to the aspnetdb database on SQL Server which is where all my roles information is stored at. My question is what are the MINIMUM permissions needed for this database so it can perform its roles related functions? I'm using Windows Authentications with the SQL Role provider for authorization.
Thank you.
EDIT: I think I only need to open the aspnetdb database and add my login to the aspnet_Roles_FullAccess role. Is that correct?
I just spent the better par of 3 days creating a prototype in ASP.Net 2.0 and SQL Server Express only to discover that nobody from outside can see it... ERROR with impersonation=true User does not have permission to perform this action. ERROR with impersonation=false Unable to open the physical file "c:inetpubwwwroot------.mdf". Operating system error 5: "5(Access is denied.)".An attempt to attach an auto-named database for file c:inetpubwwwroot-----.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. What makes this so difficult? What am I missing?
We have a back end procedure that inserts/updates records in a table. Usually the upload file will have around 20k records. This procedure is called from our application which is designed using hibernate,struts.
Upload is getting completed. But after the upload is over and control goes to application code, we are again hitting the above table to get some details. Is this the root cause for the below issue?
This is what we get in application logs,
SQL Error: 4060, SQLState: S1000 2007-04-30 16:17:27,840 - ERROR [TP-Processor2] JDBCExceptionReporter.logExceptions(58) | Cannot open database "sdgebis" requested by the login. The login failed. 2007-04-30 16:17:27,840 - WARN [TP-Processor2] JDBCExceptionReporter.logExceptions(57) | SQL Error: 18456, SQLState: 28000 2007-04-30 16:17:27,840 - ERROR [TP-Processor2] JDBCExceptionReporter.logExceptions(58) | Login failed for user 'sa'.
2007-04-30 16:17:27,856 - WARN [TP-Processor2] SQLErrorCodeSQLExceptionTranslator.translate(279) | Unable to translate SQLException with errorCode '4060', will now try the fallback translator