sql server 2008 - Classic ASP - Ado Recordset Open() -


i trying set legacy site written in asp classic on local machine. using sql server 2008 , iis ver 7.5.

i running error when try open connection database.

i used advice in this post

to use .udl file create , test connection string know connection string works. using windows authentication , app pool running site has access database use same pool multiple sites , can connect fine.

when opening connection trying run stored procedure, if write out stored proc string , run directly in database works expected.

here code:

const aduseclient = 3 const adcmdstoredproc = 4 const adopenstatic = 3 const adlockbatchoptimistic = 4  dim connectstring,sql connectstring = "provider=sqloledb.1;integrated security=sspi;persist security info=false;initial catalog=my-database;data source=(local)\sqlexpress" sql = "myproc '" & param1 & "','" & param2 & "'" set rs = server.createobject("adodb.recordset") rs.cursorlocation = aduseclient rs.cursortype = adopenstatic rs.locktype = adlockbatchoptimistic ' failing rs.open sql, connectstring, 3 

one of problems error seems generated iis, says:

an error occurred on server when processing url. please contact system administrator.

if system administrator please click here find out more error.

when click on "click here" link takes me general page running asp classic sites on iis 7, couldn't find seemed relevant error though. can't seem find information error. last resort checked in event viewer->windows applications logs there no entry errors.

i've googled , tried multiple permutations on connection string no avail. if had advice on how solve problem, or idea of solution grateful. much!

**edit: **

ok changed iis settings show errors in browser , getting error message bit more useful, here is:

microsoft ole db provider sql server error '80004005'

cannot open database "rw-gp" requested login. login failed.

now when googled found can permissions issue. can see using windows authentication , running site under app pool has permission connect database. have multiple asp.net sites set locally run in app pool , can connect using integrated security. i'm not sure going wrong, have suggestions?

an asp classic script always runs using impersonation (this different asp.net impersonation off default).

hence user needs access db virtue of use of sspi needs user being impersonated.

the impersonated user default the iusr account specified anonymous user if have turned on windows integrated security user may user account the client browser running under. in either case need make sure user being impersonated has access db or stop using sspi.

if using anonymous access can specify via iis manager account use anonymous access app pools identity.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -