Database confusion, multiple applications in one website

  • Thread starter Thread starter Ned Balzer
  • Start date Start date
N

Ned Balzer

Hi all,

I have a problem that has me stumped.

I developed an asp.net 2.0 application and it works fine. It is
located in a subweb of a website, so for instance the main site is
called intranet and the application is in intranet/subweb1. It uses a
SQL database, called subweb1.

Now I want to develop a new application at the root of the site
(basically a portal to all the subweb sites). It uses a different SQL
database, called intranet. Each database has a separate SQL user which
the web code uses to connect. So the user is named www_intranet for
the root site (and www_subweb1). The subweb has an application
starting point defined in IIS and has its own web.config and
global.asax files.

But when I try to set up a SQLDataSource in the root application which
references the intranet database, I get errors to the effect that the
www_intranet user doesn't have any rights in the subweb1 database. I
have looked through all the code for the root application, and the
subweb1 database is not even referenced at all. The root site has its
own web.config file and its own global.asax file.

So somewhere I think IIS is "confused" or has "cached" that the user is
still in the subweb application.

Can anyone explain to me why I am seeing this behavior? Is there
something I need to do besides put root-level web.config and
global.asax files in the site to tell IIS that there are two separate
applications? I came from a classic ASP background where (I assumed,
although I never tried it there) that each time you descend into a
subfolder of a website where a global.asa file can be found, and you
define a new application starting point in IIS, it is a new application
with its own application and session variables, its own database
connections etc. Or am I wrong about this?

Thanks in advance.

-- Ned Balzer
(e-mail address removed)
 
Never mind, I found the problem. In the intranet database I had a
distributed query which queried a table in the subweb1 database. So
the www_intranet user really did need access to the subweb1 database,
the way the query was structured.

-- Ned
 
Back
Top