My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks. 6 2410
re: I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful : http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this: http://weblogs.asp.net/AChang/archiv...15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your web server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message
news:e0**************@tk2msftngp13.phx.gbl... My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but eliminates the login name. How do I create the correct user so that my application can log in?
Many thanks.
You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... re: I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ? Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change the SQL Server's security to "SQL Server and Windows", instead of "Windows", create a SQL Server login for your database, and assign it the permissions you want it to have.
You'd have to change the connection string to use either the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful : http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this: http://weblogs.asp.net/AChang/archiv...15/113866.aspx (In fact, read that even if your SQL Server is in the same machine as your web server) Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:e0**************@tk2msftngp13.phx.gbl... My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but eliminates the login name. How do I create the correct user so that my application can log in?
Many thanks.
re: SqlConnection myConnection = new SqlConnection("Data Source=(local); Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... You are right that the '/' is a typo. The basic problem is exactly the one discussed in the Q316989 that you reference below. Following that article I changed SQL Server's security to "SQL Server and Windows". I created a new user of my database and modified my application connection string as follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in Q316989 fails in the same way. It is as though I need a user for SQL Server, and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... re: I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ? Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change the SQL Server's security to "SQL Server and Windows", instead of "Windows", create a SQL Server login for your database, and assign it the permissions you want it to have.
You'd have to change the connection string to use either the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful : http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this: http://weblogs.asp.net/AChang/archiv...15/113866.aspx (In fact, read that even if your SQL Server is in the same machine as your web server) Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:e0**************@tk2msftngp13.phx.gbl... My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but eliminates the login name. How do I create the correct user so that my application can log in?
Many thanks.
The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eb*************@TK2MSFTNGP15.phx.gbl... re: SqlConnection myConnection = new SqlConnection("Data Source=(local); Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is, and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the SQL Server Service Manager icon in your taskbar, or open the "Service Manager" app in the "Start Menu", "Programs", "Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance. Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... You are right that the '/' is a typo. The basic problem is exactly the one discussed in the Q316989 that you reference below. Following that article I changed SQL Server's security to "SQL Server and Windows". I created a new user of my database and modified my application connection string as follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in Q316989 fails in the same way. It is as though I need a user for SQL Server, and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... re: I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ? Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change the SQL Server's security to "SQL Server and Windows", instead of "Windows", create a SQL Server login for your database, and assign it the permissions you want it to have.
You'd have to change the connection string to use either the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful : http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this: http://weblogs.asp.net/AChang/archiv...15/113866.aspx (In fact, read that even if your SQL Server is in the same machine as your web server) Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:e0**************@tk2msftngp13.phx.gbl... My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but eliminates the login name. How do I create the correct user so that my application can log in?
Many thanks.
re: Instead of a new user for my database and loging in as him I logged in as 'sa' (the default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you're
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assigned.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl... The latest saga..
Instead of a new user for my database and loging in as him I logged in as 'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than inot my database? Obviously, I am new to SQL Server authentication and it is proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:eb*************@TK2MSFTNGP15.phx.gbl... re: SqlConnection myConnection = new SqlConnection("Data Source=(local); Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is, and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the SQL Server Service Manager icon in your taskbar, or open the "Service Manager" app in the "Start Menu", "Programs", "Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance. Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... You are right that the '/' is a typo. The basic problem is exactly the one discussed in the Q316989 that you reference below. Following that article I changed SQL Server's security to "SQL Server and Windows". I created a new user of my database and modified my application connection string as follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in Q316989 fails in the same way. It is as though I need a user for SQL Server, and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... re: > I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ? Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change the SQL Server's security to "SQL Server and Windows", instead of "Windows", create a SQL Server login for your database, and assign it the permissions you want it to have.
You'd have to change the connection string to use either the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful : http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this: http://weblogs.asp.net/AChang/archiv...15/113866.aspx (In fact, read that even if your SQL Server is in the same machine as your web server) Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:e0**************@tk2msftngp13.phx.gbl... > My application attempts to connect to an SQL Server database as name ASPNET and > Login Name SERVERNAME/ASPNET in response to these commands: > SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial > Catalog=MCSCRE;Integrated Security=SSPI"); > > myConnection.Open(); > > However, the user of this database is ASPNET. I can't create a user ASPNET with a > login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET > but eliminates the login name. How do I create the correct user so that my > application can log in? > > Many thanks. > > >
That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl... re: Instead of a new user for my database and loging in as him I logged in as 'sa' (the default SQL user) from my app. That works!
That explains a lot. The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying to *login as* doesn't have permissions to the objects for the database you're trying to use.
Add the login you want to use to SQL Server and then add that user to your database's users, and then assign permissions for that database's objects to your new user.
This is an object-by-object assignment. Make sure that all the relevant permissions to all needed objects are assigned.
Then, you should have no problem with that new user accessing your db. Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:OG**************@TK2MSFTNGP09.phx.gbl... The latest saga..
Instead of a new user for my database and loging in as him I logged in as 'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than inot my database? Obviously, I am new to SQL Server authentication and it is proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:eb*************@TK2MSFTNGP15.phx.gbl... re: SqlConnection myConnection = new SqlConnection("Data Source=(local); Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is, and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the SQL Server Service Manager icon in your taskbar, or open the "Service Manager" app in the "Start Menu", "Programs", "Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance. Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ ASPNETFAQ.COM : http://www.aspnetfaq.com/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ====================================== "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... You are right that the '/' is a typo. The basic problem is exactly the one discussed in the Q316989 that you reference below. Following that article I changed SQL Server's security to "SQL Server and Windows". I created a new user of my database and modified my application connection string as follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in Q316989 fails in the same way. It is as though I need a user for SQL Server, and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... > re: >> I can't create a user ASPNET with a login name SERVERNAME/ASPNET > > You should be able to. > > Are you sure that's not SERVERNAME\ASPNET ? > Notice the difference in the slash's direction. > > Other than that, which is probably a typo, you could change > the SQL Server's security to "SQL Server and Windows", > instead of "Windows", create a SQL Server login for your database, > and assign it the permissions you want it to have. > > You'd have to change the connection string to use either > the loginname/password you created, or a Trusted Connection. > > You'll find this to be helpful : > http://support.microsoft.com/default.aspx?kbid=316989 > > If the SQL Server is in a different machine that the web server, make > sure you read this: > http://weblogs.asp.net/AChang/archiv...15/113866.aspx > (In fact, read that even if your SQL Server is in the same machine as > your web server) > > > > Juan T. Llibre, ASP.NET MVP > ASP.NET FAQ : http://asp.net.do/faq/ > ASPNETFAQ.COM : http://www.aspnetfaq.com/ > Foros de ASP.NET en Español : http://asp.net.do/foros/ > ====================================== > "Andrew Chalk" <ac****@magnacartasoftware.com> wrote in message > news:e0**************@tk2msftngp13.phx.gbl... >> My application attempts to connect to an SQL Server database as name >> ASPNET and Login Name SERVERNAME/ASPNET in response to these >> commands: >> SqlConnection myConnection = new SqlConnection("Data >> Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI"); >> >> myConnection.Open(); >> >> However, the user of this database is ASPNET. I can't create a user >> ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager >> always keeps the name ASPNET but eliminates the login name. How do I >> create the correct user so that my application can log in? >> >> Many thanks. >> >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Matt Calhoon |
last post by:
Hi there,
I have specified a aspnet user account to run all .net sites. This account
needs access to start a .BAT File (in my global.asax on session start the app
needs to execute this bat...
|
by: Andrew J Fortune |
last post by:
Hello all,
I am trying to ascertain the difference, in terms of access and
privileges, between the Internet Guest User Account (IUSR_machinename,
where machinename is the name of your computer)...
|
by: Matthew Wieder |
last post by:
I have an ASPNET app that is running as the ASPNET machine user. It
makes a call to the API CreateProcessWithLogonW. On Windows XP it
executes without a problem, but on Windows 2000, I get an...
|
by: Harry Simpson |
last post by:
Windows Server 2003 is supposed to include Framework 1.1 right. I don't
have it here but have reports that the web is not running.
The users say that the %COMPUTERNAME%\ASPNET user doesn't exist....
|
by: Jiho Han |
last post by:
Should ASPNET user belong to the local Users group?
I may have made some changes that affected my workstation setup and I am
experiencing some unexpected behaviors.
For example, I have my IIS...
|
by: John Holmes |
last post by:
I saw a post in October that related to the problem I'm having and posted
something yesterday but never saw it show up, so I'll try again. I read
secnet.pdf and gathered from that document that one...
|
by: Kim |
last post by:
After installing MSDE2000 on my WIN XP machine, I created the database from
Access using the upsizing wizard. Although the tables can be seen from the
server explorer, I keep on encountering...
|
by: SK |
last post by:
Hi,
Would appreciate if anyone could help me on this. Basically my client
having
few branches across state. And they used Citrix in which to connect to the
server side for accessing application...
|
by: torus |
last post by:
Is the aspnet account called "aspnet" for all non-English versions of
Windows and IIS?
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |