Freelance web and mobile developer
In: IIS
24 Nov 2006Getting my legacy asp scripts to run against a Microsoft Access database on Windows Vista and IIS 7.0 took some investigation. Using Process Monitor was an enormous help when I had no clues but:
An error occurred on the server when processing the URL. Please contact the system administrator.
Hey, that’s me! And then:
Microsoft JET Database Engine error ’80004005′
Unspecified error
/myapp/myscript.asp, line 9
Ok, so I suspected that the first problem was due to the fact that I needed to activate asp scripts in some way. However, turns out it was a new setting for sending the error message to the client (maybe it has existed somewhere before, but I’ve never had to change it). This setting is located in the new IIS Manager:
Features View, ASP, Debugging Properties, Send Errors to Browser
But this only got me to the second error message. And that, I had seen before. It should have something to do with file and directory permissions. Being uncertain about which user IIS 7 actually runs legacy asp scripts as, I used Process Monitor to find the “IUSR” user. But givning that user full permissons to the directory where my.mdb resided didn’t help. So back to Process Monitor – filtering on failed operations from the w3wp.exe process. Ahh! Temporary files. Of course! The OLEDB driver needs access to the system temporary folder to store some files when opening the connection to the database file. And the location for this in Vista is:
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp
Now, UAC can really drive you mad. I wonder how long I can take it before giving up and turning it off. For security purposes, it is of course great. Then again, I’ve run Windows for a lot of years as a member of the Administrators group, and never had any real security issues. At least not any that I know of…
Pasting “C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp” into the address bar of Explorer will tell you that it doesn’t exist. Well, I didn’t believe Vista so I removed the ending directories until Vista told me that I had to elevate priviliges to get into one of the parent folders. Ok, I did that and now I could get into the full path. Great. A warning that I was changing file permissons on a system directory was all that was standing between me and success – and thankfully that was not an obstacle.
So now I’m running my old asp-scripts until I’ve had the opportunity to convert all projects to asp.net.
I'm a freelance web and mobile developer that likes to share whatever experiences I might encounter. It used to be .NET related, and still is to large extent, but I'm also a struggling agnostic trying out interesting technologies from the big three - Microsoft, Google, Apple - and the open source world.
42 Responses to Running legacy asp scripts on Vista and IIS 7.0
Soheil Malek
December 27th, 2006 at 15:02
I had same problem and solved completely, Thanks.
Tim Digital
January 1st, 2007 at 11:43
Excellent stuff Mike,
I came across the actual support article relating to this on Microsoft’s site – so thought this was the best place to share it – as I originally used your solution.
http://support.microsoft.com/kb/926939
Thanks.
Ian Haynes
January 18th, 2007 at 09:10
I’ve been though the same scenario and the details above and in the MS article helped me to get asp pages reading data from an Access db. However I can’t get writes to the db to work. They give the ‘operation must use an updatable query’ error. I’ve checked permissions and they are all OK.
What else should I be looking at?
Any thoughts appreciated
mikeplate
January 18th, 2007 at 15:48
[Ian:] It sure sounds like a permission problem. If all possible users have full rights, you might still like to write an asp-script that just creates a new text file in the same folder as the mdb-file is located. Run it and check out its result. By the way, I’ve used this method followed by checking who the owner of this file is, to be sure as to which user the asp-scripts actually are running as (if impersonation gets you confused). Also, it is not as simple as the read-only attribute on the mdb-file?
Ian Haynes
January 26th, 2007 at 12:42
Mike, It seemd like all the permissions were correct, IUSR, administrator, user etc. I then did an install of Vista + IIS7 on my laptop and went through the same process doing so, but this time reads and writes to the Access db worked. Looking at security I found an account ‘Authorised Users’ which wasn’t on the desktop settings. Having added this account to the desktop, the writes now work there too. I would have expected the IUSR settings to be the controlling factor. ?? Anyway problem solved. Your response appreciated.
Steven Clark
January 29th, 2007 at 13:13
Fantastic Mike
Thanks for posting this because it was driving me mad. I did try the microsoft solution first however it did not resolve my problem, but your did.
Thanks again
HURRAH !!
February 14th, 2007 at 23:00
Unbelievable !! Did we forget to mention that we had to convert the asp pages into an APPLICATION !!
*phew* After it drove me through wall a few times.. we have it working now !! and thanks for the thread Mike !!
Tom Blake
February 16th, 2007 at 18:03
YOU ARE MY HERO!
I trawled the internet for hours for a solution to this, the got here! Thanks very much for the information – VERY helpful!
p u b l i c v o i d . d k
February 18th, 2007 at 19:10
Running Classic ASP Pages on IIS 7.0 in Windows Vista
Jakob Okmian
February 21st, 2007 at 11:00
THANK YOU!
This wasn’t easy to solve, but thanks to your article i finally made it!
FragglePete
March 3rd, 2007 at 17:51
Mike…. You’re a star. Scratching my head for a while, but now all my Dreamweaver sites that access a MS Database now work again.
Cheers!
Kong
March 12th, 2007 at 06:49
Hi Mike… I have the same problems and tried your method but it still does not work. I can view the temp folder on my laptop, and have set the IUSR_ “modify” permission to it.. or do i have to set a different permission? Pls help!
gr0x0rd
March 13th, 2007 at 01:27
Good style Mike!
This almost got me there- I ran the commands as an admin to allow write access for the User account to the C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp folder but it still didn’t work until I added the account to the security permissions manually. Anyone who doesnt have success running the commands should be able to get up and running this way.
~g
justin
March 13th, 2007 at 06:36
Hey,
Thanks for posting this. I too had this problem and searched the internet like crazy. All the old versions of Windows had the classic “Documents and Settings/UserNameHere/AppData/Temp” folders and I kept modifying those like crazy and had no result. Thank you SO much for this post. I didn’t know there was another AppData/Temp in the freaking Windows directory…wow. Seriously, THANKS!
Ian
March 26th, 2007 at 09:59
Hi,
many thanks for this post. I was bogged down in C:\Windows\temp and getting nowhere and on the verge on uninstalling Vista. Nice one.
@rfah
May 13th, 2007 at 02:57
Hi,
i am the new user that using the vista.i want to used the odbc.but cannot find the file.after i follow ur suggestion.but its doesnt work.help me plz…i need to submitt my assignmnt…and 1 more thing,how to add the account to the security permissions manually? tQ.
beto
May 18th, 2007 at 01:06
Ok amigo parabens funcionou perfeitamente
valew abraços
Marcus
May 21st, 2007 at 16:26
Thanks so much! I don’t use ASP much these days and so when I dusted off an old site, you saved me a headache
Rob
August 3rd, 2007 at 05:47
Hi, can you break down the last part, I have been going nuts over this but if you would be able to break the part at the end down a bit for us idiots that would be great. This part:
Of course! The OLEDB driver needs access to the system temporary folder to store some files when opening the connection to the database file. And the location for this in Vista is:
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp
Now, UAC can really drive you mad. I wonder how long I can take it before giving up and turning it off. For security purposes, it is of course great. Then again, I’ve run Windows for a lot of years as a member of the Administrators group, and never had any real security issues. At least not any that I know of…
Pasting “C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp” into the address bar of Explorer will tell you that it doesn’t exist. Well, I didn’t believe Vista so I removed the ending directories until Vista told me that I had to elevate priviliges to get into one of the parent folders. Ok, I did that and now I could get into the full path. Great. A warning that I was changing file permissons on a system directory was all that was standing between me and success – and thankfully that was not an obstacle.
I got the first part working, thanks. At least now I know what the error is. If you could please, please help with this that would be fantastic. Thanks a million you are a true genius.
mikeplate
August 6th, 2007 at 07:59
Rob solved the problem by using this excellent information:
http://blogs.iis.net/bills/archive/2007/05/21/tips-for-classic-asp-developers-on-iis7.aspx
There seems to be a command you can run in order to set the permissions correctly (no need to find the folder manually).
Peter
August 22nd, 2007 at 04:31
Thank you so much Mike! I’ve spend countless hours wondering why my ASP pages that worked in XP on IIS 6.0 suddenly stopped working when I upgraded to Vista. I’ve scoured dozens of websites offering suggestions, mostly related to permissions, but yours is the first one to highlight the exact problem. So again, my brain and I thank you!
hellosuny
September 19th, 2007 at 16:05
Amazing.. No Words to THANK YOU MIKE…
All articles in MS site or Bla Bla forums FAILED. Without any faith and totally desperate, I assigned permissions to the InDepth TEMP Folder.. then without any hope, I refreshed the page.. and WHOOPS….. I got the insertion through… IT WORKED..
I am thankful to Mike.. I wasted more than 7 hours on this issue… and you saved my numerous hours that would have been wasted in other sites.
david
September 26th, 2007 at 09:40
Thank you very very much. I spend hours and hours trying to solve this darn problem. Your solution works. My ASP page works now. Thank you again.
Oistros
October 29th, 2007 at 17:39
Ok, can someone please explain why we needed Mike to let us run our simple beautiful applications in Vista? People who develeoped Vista didn’t think that someone might need to work on a classic ASP application? All articles on the Microsoft site didn’t solve the problem until i found Mike.
Common logic is something very rare in our times…
Oistros
October 29th, 2007 at 17:40
I need to add also that
MIKE=GOD
I was ready to throw my VAIO outside the window…
Peter De Rop
November 16th, 2007 at 08:05
Interesting information, I will surely need it, but first, I’m trying to get ASP to install on my machine.. IIS 7.0 installs fine, ASP.NET installs after some tweaking (removing ASP.NET from the ISAPI filters) but ASP keeps failing on install.. even when I deactivate UAC. It just says : some errors occured during install and one button : OK. After that, ASP is unchecked again, and I’m back to square 1. Any suggestions ?
John (Kent, UK)
November 26th, 2007 at 00:21
Exact same problem, fixed in a jiffy, thanks very much
Sebastian
December 15th, 2007 at 00:35
This is a great article and fixed all the issues I had. Did you know it is so hard to get a fix to this. A lot of people out there are so off.
bigric
January 8th, 2008 at 08:07
thanks Mike.
was ready to give up on editing my old client sites and switch to php and rewrite them there.
you saved me a lot of effort and time.
microsoft really doesn’t want scripted languages anymore!
cheers
kyle
January 31st, 2008 at 17:23
THANK YOU. I’m not a wordy guy but you just solved my problem of not being able to run an old asp app on my Vista box.
Fred
February 8th, 2008 at 18:10
Thanks….. You saved me a lot of hair pulling…
Phil
February 22nd, 2008 at 01:35
Thank you so much – Setting up IIS 7 to work with Vista has been such daunting task – Sometimes I think Microsoft pushes the limits of the developer and consumer when it comes to their products – They are not clear at all in the explanations needed to actually get their stuff to work – Sometimes I truly feel that the consumers and developers of the world which use Microsoft products are the true QA Department, the true testers of the products and then just summit error reports which sit in a room the size of iron mountain to be applied to a Service Patch bug fix – MIKE you are truly great – I can appreciate people like you who take the time out to endure the PAIN of trying to get things working and to be able to explain it in a simple and easy to understand format – TAKE NOTE Microsoft -
Scott
March 12th, 2008 at 16:00
Mike,
I tried all of your suggested changes and I still cannot get my ASP pages to work right under Vista/IIS 7. I have a written a simple page that queries a table in SQL Server 2000 and just returns the contents. It works fine under XP. I have added the IUSR rights to the temp folder as you indicated. I still get “Microsoft OLE DB Provider for SQL Server error ’80040e4d’
Login failed for user ‘NT AUTHORITY\IUSR’.” back from the server. I’ve tried numerous connection strings, all of which work under XP. I’ve also tried using the manual icacls changes suggested in the MS KB article. I tried setting the appPool property — still nothing. What am I missing? I’ve reverted everything back to how I found it before I started playing around. Do I need to add the IUSR to SQL Server itself? I didn’t see anything out there regarding this. Help!
Thanks!!!!
Scott
March 14th, 2008 at 12:53
Mike,
I’m going to add this information to your blog as it may help other people. Your site is one of the best in terms of describing what’s going on with IIS 7 and Classic ASP.
You wrote: “Regarding your comment on my blog post about asp scripts on Vista:
What I talked about there was only related to Microsoft Access databases, and probably have no relevance on a SQL Server connection. Your problem seems to be related to identity and integrated security (or lack thereof). The IIS process have the identity “NT AUTHORITY\IUSR” but that user does not have any permissions to the SQL Server. What identity IIS is running under can be configured, and that is probably what differs between your Vista machine and XP machine.
I’m not sure if this information might help?
http://msdn2.microsoft.com/en-us/library/aa984236(VS.71).aspx”
I kept playing around and I finally figured it out — you are completely correct in that SQL Server 2000 had a different set of issues than Access under IIS. What I needed to do was to change the security mode from Windows to Windows & SQL Server (this is the mixed mode). This is available under the Enterprise Manager by right clicking on the server name under the SQL Server Group. The top half of the security tab will let an administrator change the authentication mode. I was then able to access the server with ASP by using the following connection string: conn.ConnectionString=”Provider=sqloledb;Data Source=(local);Initial Catalog=NorthWind;User Id=sa;Password=;”
I also tried creating other user names within the security settings of SQL Server and granted them the necessary permissions to the database and each was able to access it.
So in summary, I didn’t need to change any permissions on the Temp directory nor did I need to change anything on the Application Pool in order to get Classic ASP to talk to SQL Server 2000 under IIS 7 and Vista. I just wanted to add this out here so that other people who are going through the same headache might have an easier time!
Thanks again Mike for all of the help and suggestions! It is really appreciated!!!!
Shahul
March 16th, 2008 at 08:22
How to activate asp in windows vista
Michelle
April 22nd, 2008 at 20:44
Thanks a bunch guys … esp Scott
Kevin
May 12th, 2008 at 03:18
Thanks a million….perfect fix….couldn’t be happier….
Edwin
July 7th, 2008 at 12:12
Hi Guys,
If all these things don’t work anymore after installing SP1 try giving the IUSR account full permission to C:\Windows\Temp\ as well…
I searched my ass off after the problems re-occured after installing SP 1. Tried everything again over and over nearly lost my mind
Looking at the process monitor I noticed that there where permission denied errors to this folder..
Bye,
Edwin
Surya
September 16th, 2008 at 18:40
Thanks Mike for the wonderful information explained in an easy way!
But my final word of appreciation goes to Edwin for his suggestion to give IUSR account full permission to C:\Windows\Temp as well. Only after that I could solve my problem!!
john
October 27th, 2008 at 10:36
Thanks !!!!
Matt Farmborough
November 16th, 2008 at 00:11
Edwin! You’re a legend mate. I’ve spent nearly 12 hours trying to find a solution. I tried everything I could find on google then I was reading through this and found your comment. IT WORKED! If we should ever meet I promise I will buy you all the beer you can drink mate.
Thank you so much!!!
Matt Wakeling
February 19th, 2009 at 20:31
Note for Vista x64 users…
I’ve just gone through all the recommendations on this site and many, many others still to have the dreaded error ‘80004005′ message in IE, but before I resorted to launching my PC out of the second floor window I thought I would try systematically changing some of the other settings…
luckily one of the first I changed was this little beauty which fixed the problem.
IIS7\
Features View\
Application Pools\
DefaultAppPool\
Advanced Settings\
Enable 32-bit Applications = TRUE