impersonation and ado access connection

  • Thread starter Thread starter Chance Hopkins
  • Start date Start date
C

Chance Hopkins

I am implementing impersonation in my machine.config for IIS application Isolation of the ASPNET worker process.

I am giving the new account the same permissions to files and folders that the aspnet account had.

Everything works great....EXCEPT. All connections to access databases break.

Anyone know why?
 
¤ I am implementing impersonation in my machine.config for IIS application Isolation of the ASPNET worker process.
¤
¤ I am giving the new account the same permissions to files and folders that the aspnet account had.
¤
¤ Everything works great....EXCEPT. All connections to access databases break.
¤

Could you be more specific? What do you mean by "break"? What is the error message that is being
generated?


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
All I get is this:

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

The stack trace offers no info, other than the fact that it stops when it tries to open the connection to the database.

I'm adding this in the machine.config, and appropriate NTFS permissions for the account I'm impersonating to the web directory and
bin :

<location path="Web Site Name/VDirName" allowOverride="false" >
<system.web>
<identity impersonate="true" userName="something" password="something" />
<system.web>
<location>


It works for anything that DOESN'T have an access database. To rule out NTFS issues, I went so far as to give EVERYONE full control
(with replace permissions on all child objects) for one entire site. That didn't help either. It's definitely not an NTFS issue.

I'm lost, thx for the replies.
 
¤
¤ All I get is this:
¤
¤ Exception Details: System.Data.OleDb.OleDbException: Unspecified error
¤
¤ The stack trace offers no info, other than the fact that it stops when it tries to open the connection to the database.
¤
¤ I'm adding this in the machine.config, and appropriate NTFS permissions for the account I'm impersonating to the web directory and
¤ bin :
¤
¤ <location path="Web Site Name/VDirName" allowOverride="false" >
¤ <system.web>
¤ <identity impersonate="true" userName="something" password="something" />
¤ <system.web>
¤ <location>
¤
¤
¤ It works for anything that DOESN'T have an access database. To rule out NTFS issues, I went so far as to give EVERYONE full control
¤ (with replace permissions on all child objects) for one entire site. That didn't help either. It's definitely not an NTFS issue.
¤
¤ I'm lost, thx for the replies.
¤

Can you post your connection string and the line of code where the error is generated?


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Can you post your connection string and the line of code where the error is generated?


sure, this is what I'm using for a connection:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\dir\myAccess.mdb;Jet OLEDB:Database Password=mypassword;

and I'm just calling a datareader from a function like this, with a "SELECT * FROM TableName;":

public static OleDbDataReader ReturnDataReader(string varQuery, string ConnectionString)
{
OleDbConnection connDB = new OleDbConnection(ConnectionString);
connDB.Open();
OleDbCommand commDB = new OleDbCommand(varQuery, connDB);
return commDB.ExecuteReader(CommandBehavior.CloseConnection);
}

it dies on .Open() with the impersonation.
 
¤
¤ >
¤ > Can you post your connection string and the line of code where the error is generated?
¤
¤
¤ sure, this is what I'm using for a connection:
¤
¤ Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\dir\myAccess.mdb;Jet OLEDB:Database Password=mypassword;
¤
¤ and I'm just calling a datareader from a function like this, with a "SELECT * FROM TableName;":
¤
¤ public static OleDbDataReader ReturnDataReader(string varQuery, string ConnectionString)
¤ {
¤ OleDbConnection connDB = new OleDbConnection(ConnectionString);
¤ connDB.Open();
¤ OleDbCommand commDB = new OleDbCommand(varQuery, connDB);
¤ return commDB.ExecuteReader(CommandBehavior.CloseConnection);
¤ }
¤
¤ it dies on .Open() with the impersonation.

The ConnectionString you posted has a syntax problem in the path to the database (no escape
characters):

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\dir\\myAccess.mdb;Jet
OLEDB:Database Password=mypassword;";

Also, I'm assuming that you're supplying the valid database password in your connection string?


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top