Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 7th, 2004, 11:47 AM
scm0za scm0za is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 scm0za User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post executing SQL from ASP.

Hi all,

I have been stuck on ths issue for over a week. Here goes I have created a website using ASP and SQLServer. Users are all able to execute STored procedures on the site but as soon as they try to execute SQL from a ASP page they get the following error:

HTTP 500.100 - Internal Server Error - ASP error

-----------------------------------------------

Microsoft OLE DB Provider for SQL Server (0x80040E09) SELECT permission denied on object 'tblPlatform', database 'Server_management', owner 'dbo'.

/serrver_management/searchKell.asp, line 571

I do not get this error, every other user does! ALthough I do not have a seperate SQLServer login I use the diomain LSL-UK\Domain Users.

I have a feeling it is something to do with IIS. Could it be because I am an IIS administrator and no one else is?

Any Help would be greatly appreciated.

Thanks


Reply With Quote
  #2  
Old May 7th, 2004, 12:13 PM
blicci's Avatar
blicci blicci is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Philly
Posts: 351 blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 22 h 8 m 5 sec
Reputation Power: 52
it is an sql server login issue. I'm not sure why you can access it when you run it because you shouldn't. Since you are running this from a web page, the user that is trying to access the database is ASPNET if you are using ASP.net and IUSR_<machine name> if you are running classic asp. You will need to specify the user and password in your connection string, or you can add the ASPNET/IUSR account to the database, or add the ASPNET/IUSR account to the Domain Users group.

Reply With Quote
  #3  
Old May 7th, 2004, 12:15 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 8 m 6 sec
Reputation Power: 469
What does your connectionString to the database look like?
If you are specifying a username in the connectionstring make sure that user has the correct permissions on the database.

Reply With Quote
  #4  
Old May 8th, 2004, 02:06 PM
Chizl Chizl is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 14 Chizl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post

>> I do not get this error, every other user does! ALthough
>> I do not have a seperate SQLServer login I use the
>> diomain LSL-UK\Domain Users.

You say everyone uses the same Domain User Name, but your using "LSL-UK\Domain Users" as the group for security?? I'm confused.. As a network guy, this is bad design.

I suggest if it's a public Web OR you have a lot of people using this website, then use a SQL Authentication. If it's internal and under 50 people, then use NT Security.

The ONLY reason this errors, is if the users you setup do not have rights to talk to that table. You need to go into Security | User, then make sure the users you using is setup to the right database. Then go under the database/Users and make sure you given these people rights to talk to the table. I'm guessing your not using Stored Procs, since your error in on the table and not on the proc. Also not so good.. Stored Procedures are always a better way to develop than inserting/updating/selecting direct from the ASP Page.

If your not using any NT Security, meaning, they are not prompted to put in a NETWORK username and password, and your not using SQL Authentication, meaning, your not using a username and password in the connection string, then YOU DO NOT WANT TO DO WHAT YOUR DOING! DO NOT setup Anonomous users to have rights to SQL unless you want a security hole as big as Texas on your hands.

Last edited by Chizl : May 8th, 2004 at 02:09 PM.

Reply With Quote
  #5  
Old May 10th, 2004, 04:25 AM
scm0za scm0za is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 scm0za User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi my connection string is:

strConnection = "Provider=SQLOLEDB;Integrated Security=SSPI;"
strConnection = strConnection & "Initial Catalog=Server_management;Data Source=cpmspodb5w;Connect Timeout=600"

Thing I don't understand is why I am the only person that can execute SQL from the ASP page.

Ps I am using classic ASP not ASP.NET....
Any ideas?

Reply With Quote
  #6  
Old May 10th, 2004, 05:05 AM
scm0za scm0za is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 scm0za User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>>You say everyone uses the same Domain User Name, but your using "LSL-UK\Domain >>Users" as the group for security?? I'm confused.. As a network guy, this is bad design.

I meant we all use the same Domain as in "LSL-UK\SmithC asn LSL-UK\HatfieldM".

ALl the susers can excute the STored Procedures on my site but there is a complex search that i have created which I want to execute using SQL from the ASPO page, but I am the only person that seems to be able to execute this? and the only difference I can see between myself and anyone else is that I am an IIS addministrator?

Reply With Quote
  #7  
Old May 10th, 2004, 10:28 AM
scm0za scm0za is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 scm0za User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Anybody please help......

Reply With Quote
  #8  
Old May 10th, 2004, 11:33 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 8 m 6 sec
Reputation Power: 469
remove integrated security from the connection string and replace it with a username and password and make sure that user is setup in sql server as a user for that database with the correct permissions.
Code:
"Provider=SQLOLEDB;Initial Catalog=Server_management;Data Source=cpmspodb5w;UID=username;PWD=password;Connec  t Timeout=600"

Reply With Quote
  #9  
Old May 11th, 2004, 04:18 AM
scm0za scm0za is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 scm0za User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi I was using the conn string below yesterday:

strConnection = "Provider=sqloledb;User ID=sa;Password=dbo;"
strConnection = strConnection & "Initial Catalog=Server_management;Data Source=cpmspodb5w;trusted_Connection=yes;"

But have changed it to: (cos the user group in SQL server is LSL-UK\Domain Users)

strConnection = "Provider=sqloledb;User ID=LSL-UK\Domain Users;Password=;"
strConnection = strConnection & "Initial Catalog=Server_management;Data Source=cpmspodb5w;trusted_Connection=yes;"

I dont know if this is imporatnt but when I take out trusted_Connection=yes i get the error Microsoft OLE DB Provider for SQL Server (0x80040E4D) Login failed for user 'LSL-UK\Domain Users'.

Since I have not set a password for LSL-UK\Domain Users is it Ok to leave it as Password=;

Users in LSL-UK\Domain Users can still execute all the stored procedures but cannnot perform a SELECT statement from within the ASP code???? and still get the errror
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E09)
SELECT permission denied on object 'tblPlatform', database 'Server_management', owner 'dbo'.


Although I have given the group every permission I see possible.

Can anyone please help?

Reply With Quote
  #10  
Old May 11th, 2004, 08:14 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 8 m 6 sec
Reputation Power: 469
Create a new sql server login.
Give it dbo permissions on the database and then use that username and password in your connectionstring.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > executing SQL from ASP.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT