We help IT Professionals succeed at work.

Can't get classic asp pages containing MsAccess databases runing on IIS 7!!

Hi,
I need to run classic asp pages with Access Database on IIS7... and I don't know what's wrong... I always get the Http 500 error :-S
IIS7 runs on Vista XP Home Premium.
The issue comes with pages containing databases, other classic asp pages run OK.
I've attached the piece of code that causes the problem... but It works perfect on IIS6 (on XP)
Any Idea?
Thanks,
Claudia
Set Conexion=Server.CreateObject("ADODB.Connection")
Conexion.mode=adModeReadWrite
StringConexion="Provider=Microsoft.Jet.OLEDB.4.0;" & _
              "Data Source=C:Inetpub\wwwroot\asp\Externos.mdb" ;Persist Security Info=False"
Conexion.Open(StringConexion)			  
Set R=Sever.CreateObject("ADODB.Recordset")
R.Open SQL_Cont,Conexion,adOpenStatic,adLockReadOnly,adCmdText

Open in new window

Comment
Watch Question

Bob ButcheriSeries Engineer
Commented:
Can you change the IE browser settings and uncheck show friendly messages - Tools, Internet Options, Advanced, uncheck "show friendly messages". What does the error show now?
Bob ButcheriSeries Engineer
Commented:
Set R=Sever.CreateObject("ADODB.Recordset")

should be

Set R=Server.CreateObject("ADODB.Recordset")

Author

Commented:
I get the following...
Microsoft JET Database Engine error '80004005'
Error no especificado
/asp/bd.asp, línea 36

BTW: line 36 states:
Conexion.Open(StringConexion)
Bob ButcheriSeries Engineer
Commented:
Sounds like possibly a permissions problem then if it is failing trying to create the connection object - take a look here: http://support.microsoft.com/kb/306269


Author

Commented:
I've fix the typo (sever ->server) but I still get the same error :-(
Joachim CarreinSr. Software Developer
Commented:
you should add a \ after c: in the path to your db.

Author

Commented:
Hi, I've checked permissions... I've granted IIS_IUSRS  (and all Users and Administrators groups too)Total Control to ASP folder (which contains the database and all oher *.asp pages) but ... it still doesn't work.
One more thing...Vista seems to be kidding. I removed  the "read only" attribute to the ASP folder .... and when I come back  and check it again ... it's setted to "read only" :-S

Bob ButcheriSeries Engineer
Commented:
Did you include the IWAM user as well?
Bob ButcheriSeries Engineer
Commented:
Just for the sake of testing - could you configure an ODBC connection, name a DSN to something like externos, and point to the Access database you are using. Do you still get the error? If so, I'd say it is a permissions things. If not, I'd say it is your connection string.

 Set Conexion=Server.CreateObject("ADODB.Connection")
Conexion.mode=adModeReadWrite
StringConexion="Provider=Microsoft.Jet.OLEDB.4.0;" & _
              "Data Source=C:Inetpub\wwwroot\asp\Externos.mdb" ;Persist Security Info=False"

replace with something like this:
Set Conexion=Server.CreateObject("ADODB.Connection")
Conexion.mode=adModeReadWrite
StringConexion="DSN=externos"


Commented:
I'm on VISTA ultimate and it took a lot of set up to get my classic ASP sites working again. In IIS6 you used to create applications now you don't.

Right click my computer, click manage, go to services and applications, then internet info services. Right click web sites folder and go add web site. find its pysical path in your c:\ drive. Name the website, have application pool seet to defaultAppPool. Under Binding leave everything as it is but make the port something other than 80, I started my first website on 81 and keep going up 1 each time. Click ok and your website is started. Once you've fixed all those typos mention by the other people above your site will probably work!!! (make sure the site has actually started - sometimes they create stopped and you need to start them manually).

C:Inetpub should definitely be C:\

Good luck / Suerte!
Commented:
Also, in IIS 7.0 when at the top of the file tree (the name of your computer) there is a button called 'authentication' and under this setting you will see 'Anonymous Authentification' which by default is 'Enabled'. Right click and select edit. By default the user identity will be iuser - Change this to 'Application pool identity'.

Author

Commented:
Hi!!
First ..Well, thank you all for your support.
Samic, I've configured a DSN connection (system DSN) and I get the same 80004005 error, with the following description:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][Administrador de controladores ODBC] Error de SQLSetConnectAttr del controlador
/asp/bd.asp, línea 37
Regarding to permissions... I didn't include the IWAM user ... I can't see it!!
Tobzzz: I've followed your advices too, but we have no luck yet.
What should I try next??


Commented:
what is on line 37 in bd.asp?

Author

Commented:
Line 37 has the DSN connection:
StringConexion="DSN=Externos"
Commented:
Without even having to create a site in iis7 you should be able to do this:
1. move you database (Externos.mdb) into c:\inetpub\wwwroot\
2. create a new page in that folder called test.asp with the code I attach, nothing else
3. the click http://localhost/test.asp and see if you still get a failure.

With this sort of thing it's usually best to strip the thing to the bare basics and then build your way up troubleshooting.

<%@ Language=VBscript %>
 
<%
myDatabase = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\inetpub\wwwroot\Externos.mdb; Uid=;Pwd="
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open(myDatabase)
 
conn.Close
Set conn = Nothing
%>

Open in new window

Author

Commented:
HEY!!! Problem solved :-)
I come back to check again all the permissions stuff and I've commented out line 37, so I came back to my original code ... without the typos ;-)
I went again to Authentication on IIS7 and I took a look to the website I've created running on port 81.... and I noticed that the Application pool identity has been disabled.  (I swear I did change it the 1st time!)
So... I STOPPED my site running on port 80, letting site on port 81 to stay running, and I made the autentication changes again.... and IT WORKS :-)
THANK YOU  ALL AGAIN!!
Commented:
Well It took me a good 24 hours working it all out on my own, glad i've saved you some time!

Please don't forget to accept an answer!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.