IIS 7 and Above
Fail to connect to Microsoft.Jet.Oledb under ApplicationPoolIdentity
Last post Mar 06, 2012 08:01 AM by Leo Tang - MSFT
Mar 03, 2012 07:07 AM|MarvinYan|LINK
Software environment: Windows Server 2008, IIS7.0 (UAC enabled)
Application: ASP.NET 4.0
string strConn = @"Provider = Microsoft.Jet.OleDb.4.0;Data Source=" + strPath + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1'";
var Conn = new System.Data.OleDb.OleDbConnection(strConn);
string strSQL = "select * from [sheet1$]";
var ad = new System.Data.OleDb.OleDbDataAdapter(strSQL, Conn);
This code can be executed successfully under "Network Service" account, but thrown a "unspecified error" under ApplicationPoolIdentity account.
what's more: this.FileUpload1.PostedFile.SaveAs(strPath);
this statement can be executed successfully under ApplicationPoolIdentity account, (I've add IIS_IUSERS read/write permission to the folder) so the ApplicationPoolIdentity account definitely have permission to the specified path.
What should I do to make OLEDB connection successfully under ApplicationPoolIdentity account? Thanks!
Mar 05, 2012 07:14 AM|Leo Tang - MSFT|LINK
You can adjust the loadUserProfile setting to see if it address this issue. For more information about Using Classic ASP with Microsoft Access Databases on IIS, you can refer to:
Using Classic ASP with Microsoft Access Databases on IIS
Mar 05, 2012 02:02 PM|MarvinYan|LINK
Thanks for your reply .
But I've read this article before I post this question.
I've set LoadUserProfile to false, but nothing happened.
I've give IIS_Users read/write permission to C:\Windows\Temp , too, but that doesn't help either.
Mar 06, 2012 08:01 AM|Leo Tang - MSFT|LINK
Could you please run Process Monitor on your server, isolate the database file to see what happens?