Hi,
I installed sqlserver 2005 express on windows server 2000 sp4.
I made a new database ("mydb") with sql server Management studio express
(not a mdf file).
I also defined tables and i can make and execute queries in sql server
Management studio express without problem.
I granted to account ASPNET all privileges on the directories of sql server
(read, write, modify..) in c:\program files\sql server.
But when i try to execute this aspx-code (aspnet 2.0) with IE,
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:mydbConnectionString %>"
SelectCommand="select col1 from table1;"></asp:SqlDataSource>
i get this error:
Cannot open database "madb" requested by the login. The login failed.
Login failed for user 'PEN1800\ASPNET'.
How to solve this?
Thanks
CasTo grant access to a SQL Server instance (SQL Express or
other versions), you need to add the account as a login in
SQL Server. You don't need to mess with permissions on the
database files or in the SQL Server directory.
Then to allow that login access to a database, you need to
add the login as a user in the database. Once you have done
that, you need to grant the whatever permissions are
necessary in the database.
Add the login PEN1800\ASPNET to your SQL Express instance.
Add PEN1800\ASPNET as a user to the database mydb
Grant whatever permissions are needed for PEN1800\ASPNET
-Sue
On Fri, 5 May 2006 21:30:38 +0200, "cas" <cas@.nomail> wrote:
>Hi,
>I installed sqlserver 2005 express on windows server 2000 sp4.
>I made a new database ("mydb") with sql server Management studio express
>(not a mdf file).
>I also defined tables and i can make and execute queries in sql server
>Management studio express without problem.
>I granted to account ASPNET all privileges on the directories of sql server
>(read, write, modify..) in c:\program files\sql server.
>But when i try to execute this aspx-code (aspnet 2.0) with IE,
><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
>ConnectionStrings:mydbConnectionString %>"
> SelectCommand="select col1 from table1;"></asp:SqlDataSource>
> i get this error:
>Cannot open database "madb" requested by the login. The login failed.
>Login failed for user 'PEN1800\ASPNET'.
>How to solve this?
>Thanks
>Cas
>|||Hi,
thanks for replying.
I'm new to this so sorry if it's a stupid question, but can i add the login
PEN1800\ASPNET to the SQL Express instance with 'sqlserver Management Studio
express' or i have to use sqlcmd and the command 'create login ..'.?
And about adding PEN1800\ASPNET as a user to the database mydb, can i do
that with 'sqlserver Management Studio express'?
Thanks
Cas
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:nlen525khvamen0l1viflf84g5j0lbjplg@.4ax.com...
> To grant access to a SQL Server instance (SQL Express or
> other versions), you need to add the account as a login in
> SQL Server. You don't need to mess with permissions on the
> database files or in the SQL Server directory.
> Then to allow that login access to a database, you need to
> add the login as a user in the database. Once you have done
> that, you need to grant the whatever permissions are
> necessary in the database.
> Add the login PEN1800\ASPNET to your SQL Express instance.
> Add PEN1800\ASPNET as a user to the database mydb
> Grant whatever permissions are needed for PEN1800\ASPNET
> -Sue
> On Fri, 5 May 2006 21:30:38 +0200, "cas" <cas@.nomail> wrote:
> >Hi,
> >
> >I installed sqlserver 2005 express on windows server 2000 sp4.
> >
> >I made a new database ("mydb") with sql server Management studio express
> >(not a mdf file).
> >I also defined tables and i can make and execute queries in sql server
> >Management studio express without problem.
> >I granted to account ASPNET all privileges on the directories of sql
server
> >(read, write, modify..) in c:\program files\sql server.
> >
> >But when i try to execute this aspx-code (aspnet 2.0) with IE,
> ><asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
> >ConnectionStrings:mydbConnectionString %>"
> > SelectCommand="select col1 from table1;"></asp:SqlDataSource>
> >
> > i get this error:
> >Cannot open database "madb" requested by the login. The login failed.
> >Login failed for user 'PEN1800\ASPNET'.
> >How to solve this?
> >Thanks
> >Cas
> >
>|||I don't know what you can and can't do with Management
Studio Express. When in doubt, just use sqlcmd as you can
certainly do it with t-sql statement.
-Sue
On Sat, 6 May 2006 10:15:58 +0200, "cas" <cas@.nomail> wrote:
>Hi,
>thanks for replying.
>I'm new to this so sorry if it's a stupid question, but can i add the login
>PEN1800\ASPNET to the SQL Express instance with 'sqlserver Management Studio
>express' or i have to use sqlcmd and the command 'create login ..'.?
>And about adding PEN1800\ASPNET as a user to the database mydb, can i do
>that with 'sqlserver Management Studio express'?
> Thanks
>Cas
>
>"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
>news:nlen525khvamen0l1viflf84g5j0lbjplg@.4ax.com...
>> To grant access to a SQL Server instance (SQL Express or
>> other versions), you need to add the account as a login in
>> SQL Server. You don't need to mess with permissions on the
>> database files or in the SQL Server directory.
>> Then to allow that login access to a database, you need to
>> add the login as a user in the database. Once you have done
>> that, you need to grant the whatever permissions are
>> necessary in the database.
>> Add the login PEN1800\ASPNET to your SQL Express instance.
>> Add PEN1800\ASPNET as a user to the database mydb
>> Grant whatever permissions are needed for PEN1800\ASPNET
>> -Sue
>> On Fri, 5 May 2006 21:30:38 +0200, "cas" <cas@.nomail> wrote:
>> >Hi,
>> >
>> >I installed sqlserver 2005 express on windows server 2000 sp4.
>> >
>> >I made a new database ("mydb") with sql server Management studio express
>> >(not a mdf file).
>> >I also defined tables and i can make and execute queries in sql server
>> >Management studio express without problem.
>> >I granted to account ASPNET all privileges on the directories of sql
>server
>> >(read, write, modify..) in c:\program files\sql server.
>> >
>> >But when i try to execute this aspx-code (aspnet 2.0) with IE,
>> ><asp:SqlDataSource ID="SqlDataSource1" runat="server"
>ConnectionString="<%$
>> >ConnectionStrings:mydbConnectionString %>"
>> > SelectCommand="select col1 from table1;"></asp:SqlDataSource>
>> >
>> > i get this error:
>> >Cannot open database "madb" requested by the login. The login failed.
>> >Login failed for user 'PEN1800\ASPNET'.
>> >How to solve this?
>> >Thanks
>> >Cas
>> >
>|||In Management Studio Express, look at the Security Logins folder. Add ASPNET
and set permissions in the USER MAPPING section. Since the webpage reads and
writes, I selected db_datareader and db_datawriter (and public, but not sure
this is wise for non-intranet pages?). Hope this helps get you in the area.
"Sue Hoegemeier" wrote:
> I don't know what you can and can't do with Management
> Studio Express. When in doubt, just use sqlcmd as you can
> certainly do it with t-sql statement.
> -Sue
> On Sat, 6 May 2006 10:15:58 +0200, "cas" <cas@.nomail> wrote:
> >Hi,
> >thanks for replying.
> >I'm new to this so sorry if it's a stupid question, but can i add the login
> >PEN1800\ASPNET to the SQL Express instance with 'sqlserver Management Studio
> >express' or i have to use sqlcmd and the command 'create login ..'.?
> >And about adding PEN1800\ASPNET as a user to the database mydb, can i do
> >that with 'sqlserver Management Studio express'?
> > Thanks
> >Cas
> >
> >
> >"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
> >news:nlen525khvamen0l1viflf84g5j0lbjplg@.4ax.com...
> >> To grant access to a SQL Server instance (SQL Express or
> >> other versions), you need to add the account as a login in
> >> SQL Server. You don't need to mess with permissions on the
> >> database files or in the SQL Server directory.
> >> Then to allow that login access to a database, you need to
> >> add the login as a user in the database. Once you have done
> >> that, you need to grant the whatever permissions are
> >> necessary in the database.
> >> Add the login PEN1800\ASPNET to your SQL Express instance.
> >> Add PEN1800\ASPNET as a user to the database mydb
> >> Grant whatever permissions are needed for PEN1800\ASPNET
> >>
> >> -Sue
> >>
> >> On Fri, 5 May 2006 21:30:38 +0200, "cas" <cas@.nomail> wrote:
> >>
> >> >Hi,
> >> >
> >> >I installed sqlserver 2005 express on windows server 2000 sp4.
> >> >
> >> >I made a new database ("mydb") with sql server Management studio express
> >> >(not a mdf file).
> >> >I also defined tables and i can make and execute queries in sql server
> >> >Management studio express without problem.
> >> >I granted to account ASPNET all privileges on the directories of sql
> >server
> >> >(read, write, modify..) in c:\program files\sql server.
> >> >
> >> >But when i try to execute this aspx-code (aspnet 2.0) with IE,
> >> ><asp:SqlDataSource ID="SqlDataSource1" runat="server"
> >ConnectionString="<%$
> >> >ConnectionStrings:mydbConnectionString %>"
> >> > SelectCommand="select col1 from table1;"></asp:SqlDataSource>
> >> >
> >> > i get this error:
> >> >Cannot open database "madb" requested by the login. The login failed.
> >> >Login failed for user 'PEN1800\ASPNET'.
> >> >How to solve this?
> >> >Thanks
> >> >Cas
> >> >
> >>
> >
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment