Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > impersonation and ado access connection

Reply
Thread Tools

impersonation and ado access connection

 
 
Chance Hopkins
Guest
Posts: n/a
 
      10-05-2003
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?


 
Reply With Quote
 
 
 
 
Paul Clement
Guest
Posts: n/a
 
      10-06-2003
On Sun, 5 Oct 2003 18:24:23 -0400, "Chance Hopkins" <(E-Mail Removed)> wrote:

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 ~~~ http://www.velocityreviews.com/forums/(E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
 
 
 
Chance Hopkins
Guest
Posts: n/a
 
      10-06-2003

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.



"Paul Clement" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> On Sun, 5 Oct 2003 18:24:23 -0400, "Chance Hopkins" <(E-Mail Removed)> wrote:
>
> 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 Removed)
> Microsoft MVP (Visual Basic)



 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      10-07-2003
On Mon, 6 Oct 2003 14:34:14 -0400, "Chance Hopkins" <(E-Mail Removed)> wrote:


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 Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
Chance Hopkins
Guest
Posts: n/a
 
      10-07-2003

>
> 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 OLEDBatabase 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.CloseConnecti on);
}

it dies on .Open() with the impersonation.



 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      10-08-2003
On Tue, 7 Oct 2003 15:33:00 -0400, "Chance Hopkins" <(E-Mail Removed)> wrote:


>
> 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 OLEDBatabase 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.CloseConnecti on);
}

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
OLEDBatabase Password=mypassword;";

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


Paul ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow access opening ADO connection by second user Mark S. Computer Support 5 05-16-2006 06:13 PM
Translating Oracle Package Call from ADO to ADO.Net dmiratsky@yahoo.com ASP .Net 0 02-14-2005 10:39 PM
Transfer ADO Code to ADO.NET ronaldlee ASP .Net 1 12-17-2004 04:08 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments