Link to home
Start Free TrialLog in
Avatar of bmanmike39
bmanmike39

asked on

Setting permissions for Sql Server 2005 for asp user account

How would Set permissions  Sql  Server 2005 so that I can access a  asp page created in VWD and Sql Express.

On the production server i have just the one instance of Sql

I have the following connection string in the web config file:

<connectionStrings>
        <add name="ConnectionString" connectionString="server=serversName\XPRESS;uid=aspuser;pwd=aspuserPassworkd;database=DATABName" />
    </connectionStrings>

The account i setup to access the db in Sql 2005 Proper on the Production serve is Represented by the name in the above example as “aspuser”. I created this user in security, logins. And  I gave permissions to this on the Db level “create procedure  delete, select, update insert.”

I get a error when i run the page in the browser that  says “login failed for aspuser.”

I know virtual directory is configured properly. I can run aspx page in the directory with out a db connection, without and error.

Any help would be greatly appreciated.
Avatar of appari
appari
Flag of India image

try changing the connection string to

<add name="ConnectionString" connectionString="server=serversName\XPRESS;uid=aspuser;pwd=aspuserPassworkd;Trusted_Connection=no;database=DATABName" />

Avatar of bmanmike39
bmanmike39

ASKER

Tried it, but it gave me this error:

Exception Details: System.Data.SqlClient.SqlException: Cannot open database " DATABName " requested by the login. The login failed.
Login failed for user 'aspuser'
did you map the login aspuser to use the database DATABNAME?
if not try mapping.
in management studio, open the property page of user aspuser.
you will find user mapping, click on that. on the right pane select the databases on which aspuser needs permission. click ok and try again.
I got it to work my problem was with my connection string. I thought i just had to name the db in it, but found that i had to give the path where database= C:\path\DATBName.

<connectionStrings>
        <add name="ConnectionString" connectionString="server=serversName\XPRESS;uid=aspuser;pwd=aspuserPassworkd;database=DATABName" />
    </connectionStrings>


But thanks anyway!


ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial