Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Default web site seems to have an OLE DB permission problem

Posted on 2010-08-20
25
Medium Priority
?
608 Views
Last Modified: 2012-05-10

Seems that this is a web site PERMISSION error somewhere pertaining to the MDB file located on the D drive, and I cannot find it.  

On Server this web site code WORKS fine if started in Visual Studio --- However….

On Server the code fails using http://Server IP address  or  http://localhost
On workstation code fails using http://Server IP address

Error Message, Number ->    Unspecified error, 5
Stack:    at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)

On Server IIS Virtual directory -> C:\Web_Ster  (this contains the compiled ASP.net code web site code)  IUSR_TED seems to have appropriate permissions here.

Uses “Anonymous Access”  and “Windows Authentication”
IUSR_TED  (seems to have appropriate permissions on MDB’s folder)

In IIS:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Ster\RMS\Data\rms1.mdb

In WebConfig:
<add name="RmsConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Ster\RMS\Data\rms1.mdb" providerName="System.Data.OleDb"/>

If you have any clues or suggestions where I should look, PLEASE let me know....

Thanks in advance...

0
Comment
Question by:FrankBabz
  • 10
  • 8
  • 6
24 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33490245
Access MDB's need to have write permission enabled for the web user.
0
 
LVL 10

Expert Comment

by:Espavo
ID: 33490471
What server is this running on?
I had a similar issue yesterday with an application that I just moved to Win 2008R2...it seems that Jet.OLEDB can't run in a 64-bit environment...
The work-around was to create a 32-bit application pool for it to run in...
Here's the article I read... http://learn.iis.net/page.aspx/563/using-classic-asp-with-microsoft-access-databases-on-iis-70-and-iis-75
Espavo
0
 

Author Comment

by:FrankBabz
ID: 33491562
Thanks for trying to help me.  I am really struggling with this for quite a while.

I do not know how to determine which account (IUSR, NETWORK SERVICE, SYSTEM etc) is having the problem, and I do not know how to determine which permission is needed.  Is there any kind of trace or log file that would help?  Also, I am unclear if a target folder has full permissions, does the parent folder(s) also have to have permissions?

I'm using Windows Server 2003 on an x32 computer. I am not at IIS7 level.  I assume it is an IUSR permission issue having to do with the MDB, and I think I have provided IUSR read/write/modify permissions to the target folder specifically and the D: drive in general. In IIS I do have Frontpage extensions enabled, and maybe I have an IIS issue, but don't know what to try.

All my web site code works great if run under/by Visual Studio on this server, and this leads me to believe it must be a permission issue.   In fact, when run localhost or IP all other web site features including SQLExpress and aspnetDB features work fine.  

My only problem is dealing with that MDB while running in localhost. (or IP) mode.   My web site code only reads from that MDB, but nonetheless I have granted write permissions to IUSR.

Is it possible there is some obscure Log file, or Temp file that needs permissions when the MDB is being opened/accessed?

Thanks for any clues......

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33492012
When I have used MDBs on my IIS server, I have always had to give the IUSR write permissions on the MDB file itself.  Folder permissions were not enough.  It appears that the Jet driver opens the file in read and write mode.
0
 
LVL 10

Expert Comment

by:Espavo
ID: 33492030
So, a quick way to test, is to to give the "Everyone" user FULL ACCESS rights to the .mdb folder... that way you can easily discover if it is in fact a permissions issue...
Once you've determined that, you can find which user you actually need to assign the rights to.
Espavo
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33492102
The "EVERYONE" group only includes local logon users and the GUEST account.  It does not include the IUSR anonymous logon since Windows XP.
0
 

Author Comment

by:FrankBabz
ID: 33492147
Actually I have given the containing folder and, thru inheritance, the MDB full rights for IUSR and USERS.  This did not help.   Because the code works with Visual Studio, I feel this has to be a permission issue (most likely IUSR).   But, maybe IIS,  or ???

I guess I can open up the D: drive, and then even the C: drive to IUSR,  Then start tightening it all back down when it starts working.  How awful an approach that all seems. I had hoped there would be an intelligent means to trace and find which account and target is being denied.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33492260
By the way, MDBs are single user.  You can't have it open in Access and also get to it thru web access.  Access will lock or block the MDB.
0
 
LVL 10

Expert Comment

by:Espavo
ID: 33492805
Whenever I've had issues like this, and I wasn't 100% sure if it was a "permissions" issue, I've given the folder "Everyone / Full Access"... It's either worked or it hasn't... (Generally it's worked...)
0
 

Author Comment

by:FrankBabz
ID: 33492875
Dave.. I am not sure what you mean.  Clearly an MDB is accessable in a multi-user manner unless someone has it opened for exclusive use.  I've done that for years.

Espavo.. I agree, but in this case I do not believe that the MDB's permissions are the problem.. Everyone did not fix my problem.  I'm guessing some process in establishing the connection needs something for which IUSR does not have permission.  Maybe????
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33492956
If you have an MDB open in Access, it locks the file so no one else can open it.  I know, I've accidentally done it too many times.  I'm not sure if the Jet driver does that but when you're accessing it from a web page, it opens and closes quickly so that you wouldn't notice.

And I looked at the permissions on my MDB files and I think you're right and I was wrong about that.  Just remembered, the place I had to set write permission was on the IIS web server.  Those permissions are Separate from what you see in Windows Explorer and I don't always remember that.  Default in IIS is for write permissions to be Off.  If this is a publicly available server, you want to make only the MDB file writeable.  You also want it in a non-public directory so it can't be downloaded also.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33492982
0
 

Author Comment

by:FrankBabz
ID: 33493565
Dave... I appreciate you sharing the links and concerns with using Access in a Web ap.  I am aware Access  should be avoided in a Web ap.  I am not using Access in my Web ap. All I am doing is opening a 3rd party created MDB.... using Jet to grab (read only) some data... and disconnecting.  

All my other web ap database work is done with SQL server, and that part is working fine (until I open that MDB, that is).
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 33493594
Good, didn't mean to be obnoxious about it.  Did you take a look at IIS permissions for that file or folder?
0
 

Author Comment

by:FrankBabz
ID: 33493670
Dave...  My web site is in a folder on the C: drive and all IIS permissions there look OK
The MDB is in a folder on the D: drive and out of IIS pervue.  Excepting that IIS provides that IUSR is to used for anonymous access, and IUSR is fully permissioned to deal with the MDB.

It is time (I think) to look somewhere else.
0
 
LVL 10

Expert Comment

by:Espavo
ID: 33494106
Just wondering... have you tried giving the folder "Everyone / Full" permissions to see if it works?
0
 

Author Comment

by:FrankBabz
ID: 33495460
Yes I did...  and it did not help.
Thanks for the suggestion....
0
 
LVL 10

Expert Comment

by:Espavo
ID: 33495595
If THAT didn't work, then I don't think it's a permissions error...
(What makes you think it is?)
0
 

Author Comment

by:FrankBabz
ID: 33495630
When I run this code under Visual Studio it works fine.
Thanks for trying...
0
 

Author Comment

by:FrankBabz
ID: 33504470
Here is perhaps an incomplete, but very satisfying conclusion...
FYI....search: "ASP.NET Required Access Control Lists (ACLs)"

In the chart refer to row 4 where it advises:
%SystemRoot%\Temp requires "read/write/delete"  access.

I applied these permissions to the temp folder for IUSR, and all is now working.
I am totally lost as to why this appears mandatory, and is not made more obvious.....

Thanks to both of you for your assistance, and I hope this reply one-day saves you a lot of future grief.

Best wishes,
Frank
0
 
LVL 10

Accepted Solution

by:
Espavo earned 1000 total points
ID: 33504696
Very weird... and interesting...
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 33505068
I would have thought that was already set correctly.  I just keep on learning things.
0
 

Author Comment

by:FrankBabz
ID: 33505226
Well, I guess, ASP.NET does not know to whom you will impersonate or assign permssions, and you may change them.....   Nonetheless, I think there should be some help somewhere (in code) to help identify "mandatory" permssions.   Maybe there is, but it did not help me.

BTW:  I have not followed up on all 8 rows in the table.  I was going to do them one at a time, and I chose temp first, and when it worked I posted above.  For sure, you want to include App_Data (that I would certainly seem should be done automatic).
0
 

Author Closing Comment

by:FrankBabz
ID: 33807785
Thanks for your comments and suggestions that led to the solution.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question