I created a webpage where someone can enter in new client
info. Using asp, I want to connect to the sql db and add
the new record. I'm using SQL2k in an W2K environment. I
want to use the trusted connection so SQL would use the
windows login to authenticate. Below is the code for
connecting to the sql server:
<%
dim cn, cs
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=webbus\lab;TRUSTED_CONNECTION=YES;DATABASE= Client"
Set cs = Server.CreateObject("ADODB.Recordset")
cs.Open "SELECT * FROM CallerTest"
%>
When I click the Save button on the webpage to add the new
info, I get this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'WEBBUS\IUSR_WEBBUS'.
/lab/addnew.asp, line 95
Line 95 is the cn.Open line
What am I missing?
Ngan,
trusted security means that it'll use the IUSR_IISCOMPUTERNAME user for
anonymous access by default. This is configurable to another domain user in
IIS on the security tab for your website. If you want to use windows logins,
then you must disable anonymous and have windows integrated impersonation.
HTH,
Paul Ibison
|||How do I go about disabling the anonymous and having the
windows integrated impersonation?
Thanks!
>--Original Message--
>Ngan,
>trusted security means that it'll use the
IUSR_IISCOMPUTERNAME user for
>anonymous access by default. This is configurable to
another domain user in
>IIS on the security tab for your website. If you want to
use windows logins,
>then you must disable anonymous and have windows
integrated impersonation.
>HTH,
>Paul Ibison
>
>.
>
|||Programs, Administrative Tools, IIS. Select the website then right-click
proerties, directory security, edit. Untick enable anonymous access and tick
Integrated Windows Authentication. It's worth reading up on the options here
as if this is an internet site (rather than intranet or extranet) then
you'll need Basic Authentication, preferably with SSL.
HTH,
Paul Ibison
|||Thanks for that info! This will be an intranet website so
I'll just do the integrated windows thingie.
Currently, I have people from our provider companies
connected to me via a T1, so they don't have a windows
login. They are accessing the website anonymously, I
assume. If I turn off the anonymous access, I take it
they won't be able to view the website anymore.
How do I go about giving them "guest" access? Do I give
each company their own user account or group them somehow
into one guest group?
Thanks.
Ngan
>--Original Message--
>Programs, Administrative Tools, IIS. Select the website
then right-click
>proerties, directory security, edit. Untick enable
anonymous access and tick
>Integrated Windows Authentication. It's worth reading up
on the options here
>as if this is an internet site (rather than intranet or
extranet) then
>you'll need Basic Authentication, preferably with SSL.
>HTH,
>Paul Ibison
>
>.
>
|||They can access the site, but the windows login dialog box will come up.
Regards,
Paul Ibison
|||Sorry,
misread your previous post - yes, the previously anonymous users will be
prompted with a windows login dialog box. You'll need to give them a login
they can use. If all people use this login then you might as well go back to
anonymous, but if this is yust a subset of people then creating separate
windows logins makes sense. Alternatively you could use forms logins for
either ASP or ASP.NET.
Regards,
Paul Ibison
sqlsql
Showing posts with label webpage. Show all posts
Showing posts with label webpage. Show all posts
Sunday, March 25, 2012
connecting to sql from ASP
I created a webpage where someone can enter in new client
info. Using asp, I want to connect to the sql db and add
the new record. I'm using SQL2k in an W2K environment. I
want to use the trusted connection so SQL would use the
windows login to authenticate. Below is the code for
connecting to the sql server:
<%
dim cn, cs
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=webbus\lab;TRUSTED_CONNECTION=YES
;DATABASE=Client"
Set cs = Server.CreateObject("ADODB.Recordset")
cs.Open "SELECT * FROM CallerTest"
%>
When I click the Save button on the webpage to add the new
info, I get this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'WEBBUS\IUSR_WEBBUS'.
/lab/addnew.asp, line 95
Line 95 is the cn.Open line
What am I missing?Ngan,
trusted security means that it'll use the IUSR_IISCOMPUTERNAME user for
anonymous access by default. This is configurable to another domain user in
IIS on the security tab for your website. If you want to use windows logins,
then you must disable anonymous and have windows integrated impersonation.
HTH,
Paul Ibison|||How do I go about disabling the anonymous and having the
windows integrated impersonation?
Thanks!
>--Original Message--
>Ngan,
>trusted security means that it'll use the
IUSR_IISCOMPUTERNAME user for
>anonymous access by default. This is configurable to
another domain user in
>IIS on the security tab for your website. If you want to
use windows logins,
>then you must disable anonymous and have windows
integrated impersonation.
>HTH,
>Paul Ibison
>
>.
>|||Programs, Administrative Tools, IIS. Select the website then right-click
proerties, directory security, edit. Untick enable anonymous access and tick
Integrated Windows Authentication. It's worth reading up on the options here
as if this is an internet site (rather than intranet or extranet) then
you'll need Basic Authentication, preferably with SSL.
HTH,
Paul Ibison|||Thanks for that info! This will be an intranet website so
I'll just do the integrated windows thingie.
Currently, I have people from our provider companies
connected to me via a T1, so they don't have a windows
login. They are accessing the website anonymously, I
assume. If I turn off the anonymous access, I take it
they won't be able to view the website anymore.
How do I go about giving them "guest" access? Do I give
each company their own user account or group them somehow
into one guest group?
Thanks.
Ngan
>--Original Message--
>Programs, Administrative Tools, IIS. Select the website
then right-click
>proerties, directory security, edit. Untick enable
anonymous access and tick
>Integrated Windows Authentication. It's worth reading up
on the options here
>as if this is an internet site (rather than intranet or
extranet) then
>you'll need Basic Authentication, preferably with SSL.
>HTH,
>Paul Ibison
>
>.
>|||They can access the site, but the windows login dialog box will come up.
Regards,
Paul Ibison
info. Using asp, I want to connect to the sql db and add
the new record. I'm using SQL2k in an W2K environment. I
want to use the trusted connection so SQL would use the
windows login to authenticate. Below is the code for
connecting to the sql server:
<%
dim cn, cs
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=webbus\lab;TRUSTED_CONNECTION=YES
;DATABASE=Client"
Set cs = Server.CreateObject("ADODB.Recordset")
cs.Open "SELECT * FROM CallerTest"
%>
When I click the Save button on the webpage to add the new
info, I get this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'WEBBUS\IUSR_WEBBUS'.
/lab/addnew.asp, line 95
Line 95 is the cn.Open line
What am I missing?Ngan,
trusted security means that it'll use the IUSR_IISCOMPUTERNAME user for
anonymous access by default. This is configurable to another domain user in
IIS on the security tab for your website. If you want to use windows logins,
then you must disable anonymous and have windows integrated impersonation.
HTH,
Paul Ibison|||How do I go about disabling the anonymous and having the
windows integrated impersonation?
Thanks!
>--Original Message--
>Ngan,
>trusted security means that it'll use the
IUSR_IISCOMPUTERNAME user for
>anonymous access by default. This is configurable to
another domain user in
>IIS on the security tab for your website. If you want to
use windows logins,
>then you must disable anonymous and have windows
integrated impersonation.
>HTH,
>Paul Ibison
>
>.
>|||Programs, Administrative Tools, IIS. Select the website then right-click
proerties, directory security, edit. Untick enable anonymous access and tick
Integrated Windows Authentication. It's worth reading up on the options here
as if this is an internet site (rather than intranet or extranet) then
you'll need Basic Authentication, preferably with SSL.
HTH,
Paul Ibison|||Thanks for that info! This will be an intranet website so
I'll just do the integrated windows thingie.
Currently, I have people from our provider companies
connected to me via a T1, so they don't have a windows
login. They are accessing the website anonymously, I
assume. If I turn off the anonymous access, I take it
they won't be able to view the website anymore.
How do I go about giving them "guest" access? Do I give
each company their own user account or group them somehow
into one guest group?
Thanks.
Ngan
>--Original Message--
>Programs, Administrative Tools, IIS. Select the website
then right-click
>proerties, directory security, edit. Untick enable
anonymous access and tick
>Integrated Windows Authentication. It's worth reading up
on the options here
>as if this is an internet site (rather than intranet or
extranet) then
>you'll need Basic Authentication, preferably with SSL.
>HTH,
>Paul Ibison
>
>.
>|||They can access the site, but the windows login dialog box will come up.
Regards,
Paul Ibison
Friday, February 17, 2012
Connecting a webpage to SQL
I would like to know how to go about doing this.
I have a table ClientInfo in SQL 2k. I want the customer
service dept to be able to add new clients and search for
ones to edit. I want other groups to be able to only view
client info read-only.
1. I assume creating a webpage is probably better than
an .adp file?
2. If I do a webpage, how do I deal with the
permissions? Should I create a login table and add all
the users/pwd in there and set the level of security that
way? Or is there a way to base it off of Windows active
directory groups?
Thanks.
You can set the security with in SQL Server based on the NT users. You can
create a view that has the data that you wan the users to view and then
only give select permissions to the to those users.
In other words use teh security mechnism within SQL Server to set the
security.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Thanks!
I use the dsnless connection string for trusted_connection
to base ithe permissions on the user.
However, the windows login box does pop up for them to
enter in username/pwd/domain.
Is there a way that sql grabs the user info automatically
and set the perms that way?
If I have a default page and links to an edit page, is
there a way to use the user info to disallow certain
people from entering that page?
Ngan
>--Original Message--
>You can set the security with in SQL Server based on the
NT users. You can
>create a view that has the data that you wan the users to
view and then
>only give select permissions to the to those users.
>In other words use teh security mechnism within SQL
Server to set the
>security.
>Rand
>This posting is provided "as is" with no warranties and
confers no rights.
>.
>
I have a table ClientInfo in SQL 2k. I want the customer
service dept to be able to add new clients and search for
ones to edit. I want other groups to be able to only view
client info read-only.
1. I assume creating a webpage is probably better than
an .adp file?
2. If I do a webpage, how do I deal with the
permissions? Should I create a login table and add all
the users/pwd in there and set the level of security that
way? Or is there a way to base it off of Windows active
directory groups?
Thanks.
You can set the security with in SQL Server based on the NT users. You can
create a view that has the data that you wan the users to view and then
only give select permissions to the to those users.
In other words use teh security mechnism within SQL Server to set the
security.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Thanks!
I use the dsnless connection string for trusted_connection
to base ithe permissions on the user.
However, the windows login box does pop up for them to
enter in username/pwd/domain.
Is there a way that sql grabs the user info automatically
and set the perms that way?
If I have a default page and links to an edit page, is
there a way to use the user info to disallow certain
people from entering that page?
Ngan
>--Original Message--
>You can set the security with in SQL Server based on the
NT users. You can
>create a view that has the data that you wan the users to
view and then
>only give select permissions to the to those users.
>In other words use teh security mechnism within SQL
Server to set the
>security.
>Rand
>This posting is provided "as is" with no warranties and
confers no rights.
>.
>
Labels:
clientinfo,
clients,
connecting,
customerservice,
database,
dept,
microsoft,
mysql,
oracle,
server,
sql,
table,
webpage
Subscribe to:
Posts (Atom)