Database confusion, multiple applications in one website

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)
 
N

Ned Balzer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top