Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP: ATL COM w/ ADO and Access DB hosted on IIS 5.0

2 views
Skip to first unread message

Chester Kuei

unread,
May 10, 2002, 3:26:57 PM5/10/02
to
Hi all,

I have some problems/questions regarding an ATL COM object using ADO to
access a Microsoft Access (.MDB) file. What the object does is every 5
minutes or so, it will connect to the .MDB file and perform some queries.
Here is a summary of my scenario:

The COM object is hosted on an IIS 5.0 server.
The COM object is 'Both' threaded, and set to Application scope with the
<OBJECT> tag in the global.asa
The COM object launches a new thread that handles the timer functions and
performs the queries.
The web application is set to run as an administrator account through the
IIS console manager.

The pseudo-code looks somewhat like this:
try {
ADODB::Open("MDB Database");
...
}
catch(_com_error e) {
PrintError(e);
Print(GetUserNameEx(...));
}

The problem is this: If the .MDB file is open, ADO seems to need
write/modify access to the directory containing the .MDB file (to write the
lock files I believe), which I have given to the administrator account. The
weird thing is that even though I specified the web application to run as an
administrator account, when the Open() function throws an error, the Win32
API GetUserNameEx() function prints out the IWAM user account. (??) This is
when the web application is set to run in the "high" or "medium pooled"
settings. This "somewhat" makes sense since at these settings, the
application is running in a DLLHOST process instead of the INETINFO process.
However, shouldn't it be running as administrator instead of IWAM? If I
change the application setting to "low", it runs fine even when the .MDB
file is open in Microsoft Access.

Questions:
1. Why is the IWAM account being used when I specify the web application to
run as administrator?
2. What is the best solution to handle this situation? I would not want to
have to configure the IWAM account on every possible host machine.
3. When the web application is set to "low", it runs fine even when the
.MDB file is open in Microsoft Access. In this case, what context is the
application running in? SYSTEM?

I would just like to know exactly what is going on and how best to approach
this. Any help appreciated, thanks!

0 new messages