Sunday, February 19, 2012
access one remote SQL server using 2 different users accounts via Enterprise Manager
I ran into a strange situation. I need to access the same remote SQL
server using 2 different user accounts at the same time. I can't seem
to do it using Enterprise Manager.
This is the first time I ran into this type of problem. I signed up for
web hosting service with a company called Netnation. They have a
strange policy- everytime, I create a database on their MS SQL server,
they give me a new user account to access the new database. so if i own
2 databases, then i will have to use 2 user names for the databases.
each user name can only access one database.
I am have problem configuring my Enterprise Manager to allow me to see
more than one database at a time because of the "one -user-one
-database" problem.
Does anyone know if there is anyway i can set up Enterprise Manager to
get round this problem?
Thank you in advance!
Eddy
One option is to register the server twice - create an alias
for the server and then register the second one with that
alias. You can use the second set of credentials to register
the second instance of the server with the alias.
So you'd end up with two server nodes pointing to the same
server but it would still be in one Enterprise Manager
console.
-Sue
On 16 Jan 2006 16:39:52 -0800, eddiekwang@.hotmail.com wrote:
>Hello,
>I ran into a strange situation. I need to access the same remote SQL
>server using 2 different user accounts at the same time. I can't seem
>to do it using Enterprise Manager.
>This is the first time I ran into this type of problem. I signed up for
>web hosting service with a company called Netnation. They have a
>strange policy- everytime, I create a database on their MS SQL server,
>they give me a new user account to access the new database. so if i own
>2 databases, then i will have to use 2 user names for the databases.
>each user name can only access one database.
>I am have problem configuring my Enterprise Manager to allow me to see
>more than one database at a time because of the "one -user-one
>-database" problem.
>Does anyone know if there is anyway i can set up Enterprise Manager to
>get round this problem?
>Thank you in advance!
>Eddy
|||Sue,
Thanks for the reply. I already tried registering the server twice but
it didn't let me. I can't remember the specifics of the error message.
Did it ever work for you?
Eddy
|||Hi Eddy,
Yes...worked fine. You need to have it registered under a
different name than the current registration. That's why I
said to create an alias first. Then register the alias. You
probably tried to register it twice with the same name.
-Sue
On 20 Jan 2006 12:34:49 -0800, eddiekwang@.hotmail.com wrote:
>Sue,
>Thanks for the reply. I already tried registering the server twice but
>it didn't let me. I can't remember the specifics of the error message.
>Did it ever work for you?
>Eddy
access one remote SQL server using 2 different users accounts via Enterprise Manager
I ran into a strange situation. I need to access the same remote SQL
server using 2 different user accounts at the same time. I can't seem
to do it using Enterprise Manager.
This is the first time I ran into this type of problem. I signed up for
web hosting service with a company called Netnation. They have a
strange policy- everytime, I create a database on their MS SQL server,
they give me a new user account to access the new database. so if i own
2 databases, then i will have to use 2 user names for the databases.
each user name can only access one database.
I am have problem configuring my Enterprise Manager to allow me to see
more than one database at a time because of the "one -user-one
-database" problem.
Does anyone know if there is anyway i can set up Enterprise Manager to
get round this problem?
Thank you in advance!
EddyOne option is to register the server twice - create an alias
for the server and then register the second one with that
alias. You can use the second set of credentials to register
the second instance of the server with the alias.
So you'd end up with two server nodes pointing to the same
server but it would still be in one Enterprise Manager
console.
-Sue
On 16 Jan 2006 16:39:52 -0800, eddiekwang@.hotmail.com wrote:
>Hello,
>I ran into a strange situation. I need to access the same remote SQL
>server using 2 different user accounts at the same time. I can't seem
>to do it using Enterprise Manager.
>This is the first time I ran into this type of problem. I signed up for
>web hosting service with a company called Netnation. They have a
>strange policy- everytime, I create a database on their MS SQL server,
>they give me a new user account to access the new database. so if i own
>2 databases, then i will have to use 2 user names for the databases.
>each user name can only access one database.
>I am have problem configuring my Enterprise Manager to allow me to see
>more than one database at a time because of the "one -user-one
>-database" problem.
>Does anyone know if there is anyway i can set up Enterprise Manager to
>get round this problem?
>Thank you in advance!
>Eddy|||Sue,
Thanks for the reply. I already tried registering the server twice but
it didn't let me. I can't remember the specifics of the error message.
Did it ever work for you?
Eddy|||Hi Eddy,
Yes...worked fine. You need to have it registered under a
different name than the current registration. That's why I
said to create an alias first. Then register the alias. You
probably tried to register it twice with the same name.
-Sue
On 20 Jan 2006 12:34:49 -0800, eddiekwang@.hotmail.com wrote:
>Sue,
>Thanks for the reply. I already tried registering the server twice but
>it didn't let me. I can't remember the specifics of the error message.
>Did it ever work for you?
>Eddy
access one remote SQL server using 2 different users accounts via Enterprise Manager
I ran into a strange situation. I need to access the same remote SQL
server using 2 different user accounts at the same time. I can't seem
to do it using Enterprise Manager.
This is the first time I ran into this type of problem. I signed up for
web hosting service with a company called Netnation. They have a
strange policy- everytime, I create a database on their MS SQL server,
they give me a new user account to access the new database. so if i own
2 databases, then i will have to use 2 user names for the databases.
each user name can only access one database.
I am have problem configuring my Enterprise Manager to allow me to see
more than one database at a time because of the "one -user-one
-database" problem.
Does anyone know if there is anyway i can set up Enterprise Manager to
get round this problem?
Thank you in advance!
EddyOne option is to register the server twice - create an alias
for the server and then register the second one with that
alias. You can use the second set of credentials to register
the second instance of the server with the alias.
So you'd end up with two server nodes pointing to the same
server but it would still be in one Enterprise Manager
console.
-Sue
On 16 Jan 2006 16:39:52 -0800, eddiekwang@.hotmail.com wrote:
>Hello,
>I ran into a strange situation. I need to access the same remote SQL
>server using 2 different user accounts at the same time. I can't seem
>to do it using Enterprise Manager.
>This is the first time I ran into this type of problem. I signed up for
>web hosting service with a company called Netnation. They have a
>strange policy- everytime, I create a database on their MS SQL server,
>they give me a new user account to access the new database. so if i own
>2 databases, then i will have to use 2 user names for the databases.
>each user name can only access one database.
>I am have problem configuring my Enterprise Manager to allow me to see
>more than one database at a time because of the "one -user-one
>-database" problem.
>Does anyone know if there is anyway i can set up Enterprise Manager to
>get round this problem?
>Thank you in advance!
>Eddy|||Sue,
Thanks for the reply. I already tried registering the server twice but
it didn't let me. I can't remember the specifics of the error message.
Did it ever work for you?
Eddy|||Hi Eddy,
Yes...worked fine. You need to have it registered under a
different name than the current registration. That's why I
said to create an alias first. Then register the alias. You
probably tried to register it twice with the same name.
-Sue
On 20 Jan 2006 12:34:49 -0800, eddiekwang@.hotmail.com wrote:
>Sue,
>Thanks for the reply. I already tried registering the server twice but
>it didn't let me. I can't remember the specifics of the error message.
>Did it ever work for you?
>Eddy
Access Memo field to SQL Server Text field
I'm importing an Access database to SQL Server 2000.
The issue I ran into is pretty frustrating... All Memo fields that get copied over (as Text fields) appear to be fine and visible in SQL Server Enterprise Manager... except when I display them on the web via ASP - everything is blank (no content at all).
I didn't have that problem with Access, so I ruled out the possibility that there's something wrong with the original data.
Is this some sort of an encoding problem that arose during database import?
I would appreciate any pointers.If the data is visible within SQL Server, but not from your ASP page, then the problem is with your ASP page and the way it is pulling the text data.
Do you really need this to be a text field? The varchar datatype will handle up to 8000 bytes.|||That's a good point - I might be able to get away with varchar. It's something I'll look into, but I'm still curious as to why the data behaves this way (I ran into similar problems in the past while trying to import Access data to SQL server).
My ASP page is functioning properly. I use a simple "SELECT *" statement to pull the data and display it on the page. With an Access DSN it encounters no problems and shows all the data as intended. When I import the data into SQL Server and swap the DSN to point to the newly-created database (while not modifying the ASP page itself in any way) the text fields display no content.|||A text field in SQL Server is not stored within the record. The record actually only stores a pointer to the location of the actual data. This may be why your page is not handling it properly, but I don't know the work-around. You could try posting your question on the ASP forum.|||Interesting... I was aware that Text fields are stored differently and separately from the regular data in the database, but I didn't think it would affect the way they're displayed through the recordset...
Maybe there's something that can be done on the ASP side - I'll ask some ASP guys.
Thanks.|||Interesting... I was aware that Text fields are stored differently and separately from the regular data in the database, but I didn't think it would affect the way they're displayed through the recordset...I wouldn't have thought so either, but it is my best guess.
What happens in your ASP code if you enumerate the column names rather than using "select *" (which is a bad practice anyway)?|||I use a simple "SELECT *" statement to pull the data and display it on the page.
ahhhhhhhhhhhhhhhhhhhhhhhhhhh
http://weblogs.sqlteam.com/brettk/archive/2004/04/22/1272.aspx|||I try to do it properly with larger systems and database, but, yeah, for me it's laziness that makes me use "Select *"...|||I try to do it properly with larger systems and database, but, yeah, for me it's laziness that makes me use "Select *"...
Hey! No one's lazier than me....
SELECT ', ' + COLUMN_NAME FROM INFORMATION_SCHEMA.Columns
WHERE TABLE_NAME = 'xxx'
ORDER BY ORDINAL_POSITION
SELECT * can buy you a boatload of trouble...so it's amatter how you want to spend your laziness...you have no choice when you have exploding code|||I wouldn't have thought so either, but it is my best guess.
What happens in your ASP code if you enumerate the column names rather than using "select *" (which is a bad practice anyway)?
Well, that's an interesting question, mostly because it gives me some sort of a deja vu feeling - as if I encountered something like this several years ago...
It's possible that I did something like this in the past and fixed the problem that way.
I'll check into this on Thursday when I'm back at work.
Thanks.|||You are off UNTIL Thursday?
Okay, but this Thursday is Turkey Day for us Yanks, so you'll have to depend upon the Pootle Flumps and Cannucks of the world to help you out.|||Hey! No one's lazier than me....
SELECT ', ' + COLUMN_NAME FROM INFORMATION_SCHEMA.Columns
WHERE TABLE_NAME = 'xxx'
ORDER BY ORDINAL_POSITION
SELECT * can buy you a boatload of trouble...so it's amatter how you want to spend your laziness...you have no choice when you have exploding code
That's an interesting way to structure a query - I've never done it this way before.
Dare to dream... Sorry, you think that you're the laziness champ, but you're not. Your laziness doesn't compare to mine - not even close.|||You are off UNTIL Thursday?
Okay, but this Thursday is Turkey Day for us Yanks, so you'll have to depend upon the Pootle Flumps and Cannucks of the world to help you out.
Yes, it sounds a bit odd. I'm actually at work as we speak, but I also have another part time job as a contractor with my previous employer. Thanksgiving will be a good time to come in and get a bunch of work out of the way.|||See but here's the rub, my laziness is born out of economy of effort..the smarter you work, the less you have to
some laziness makes your life more simple, other types make your life much more difficult, you have to decide|||See but here's the rub, my laziness is born out of economy of effort..the smarter you work, the less you have to
some laziness makes your life more simple, other types make your life much more difficult, you have to decide
Agree. Mine usually gets me in trouble somewhere down the line.
... but it still feels good to be the "Champ" :)
Thursday, February 9, 2012
access denied for user <machine name>\ASPNET
I've just started to learn to use Visual Studio, and has come to database access.
I ran into this errormessage:
access denied for user <machine name>\ASPNET
The book I'm using just only say that I have to grant the ASPNET user account permissions before the Web application will have access to a SQL database. ... Seems clear at first glance ... but I lack a "how to" ...!
--
I've tried to search the net for solutions ... several thousands of pages came up ... indicating that I'm far from the first who have this problem. ... So after I now have spend hours reading, without finding any useful ansver to the question. ...
So let me just tell the most popular answers. (So You don't repeat something I allready have read hundreds of times.):
This question has been asked before
Yes, true answer, but it doesn't help.
See the FAQ
If it was stated were in the FAQ to look it could have been useful.
Use something called "enterprise manager" (WIN XP pro, don't have this, though.)
I use WIN XP pro, so that answer dosn't help me either.
--
Hope some one can help.Do you have SQL Server installed on the machine in question? If so, Enterprise Manager will be there (it will run fine on XP pro). You will not have Enterprise Manager if you have MSDE, in which case you need to use osql.exe:
This article explains various ways to work with MSDE. Note that the "Grant permissions to the ASPNET account" is the section to do what you need to do, given your current connection string.|||Yes, I have this osql.exe program. But when I try to use it, it comes up with an access denied error message.
I found another solution to the problem: Moving the ASPNET user from "Restricted user" to "Administrators".
I was a bit hesitant to do this at first (At first glance it appears a bit unsafe to do so.), but when I realized that it is commonly done that way, and when I tried it myself everything did run as it was supposed to. (So ... problem solved!)|||This is areally, really bad idea. The reason MS used the restricted account by default is to make your machine secure. Moving the ASPNET user to the Administrators group is aterrible idea.
Just cause it works, does not mean it is correct.|||Let me reiterate what Doug just said.
Moving the ASPNET user to the Administrators group is a terrible idea.
Don't do it! If someone manages to compromise your server through your website (such as through a SQL injection exploit) they will have unlimited access to run/install/ruin whatever they want on the machine.
Terri