Multiple Databases!?!?!? Ideas on a postcard please. 
Author Message
 Multiple Databases!?!?!? Ideas on a postcard please.

Hi,

We've built a multi tiered (xml based) framework that we use to build and
run our web sites.  For the past 2 years we've always run off one database
source but now want to use more.  That is if you got to one website it will
go to one database and if you go to a different web site using the same
framework we can make it go to a different database.  The problem we've got
is that we've created a database wrapper which reads from the registry the
database details (not pwd info), creates and returns a connection up to the
Data Access Layer components.  This works a treat except that we now need
some way to tell the Database wrapper which database to look at.  The
obvious thing is to simply have an extra parameter on the database wrapper
method BUT we only know which which website is being called (i.e. and which
database to look at) from the ASP pages but this would mean doing something
like:

ASP (UI layer)
    Dim oBizPlugIn
    Set oBizplugIn = Server.createobject(progid)

    oBizPlugIn.doSomeStuff("USETHISDATASOURCE", .. some other params)
    Set oBizPlugIn = Nothing

    This would then call the Business objects which would then call the Data
Access Layer which would then call the Database wrapper to finally execute
the call.

In a layered approach, the UI Layer, Business Layer and even the Data Layers
shouldn't really know what database to use (it's only the database wrapper)
but I can't see anyway of doing this cleanly other than the ASP telling the
database wrapper what to do but that would mean passing the datasource (or
some sort of key) info from the ASP pages all the way down.  They're got to
be a cleaner approach than this .. sadly I can't think of one at this time
..

Many thanks for your time.



Sat, 17 Apr 2004 02:27:55 GMT  
 Multiple Databases!?!?!? Ideas on a postcard please.
Hello,

Thank you for using the Microsoft Newsgroups.

Since your business logic requires different results for different
websites, website should be a parameter.

That is: your UI Layer, Business Layer and the Data Layers should know
which website is consuming the component. So, I think you can pass the
website as the parameter instead of the data source.

Your ASP code might be the following (pass the server name of the web site
as the parameter):
ASP (UI layer)
    Dim oBizPlugIn
    Set oBizplugIn = Server.createobject(progid)

    oBizPlugIn.doSomeStuff(Request.ServerVariables("SERVER_NAME"), .. some
other params)
    Set oBizPlugIn = Nothing

Then your Data Access Layer can define which data souce should be used for
this web server.

Please feel free to let me know if you have any questions.

Best Regards,  
Kenny Zhou
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.



Tue, 20 Apr 2004 09:57:17 GMT  
 Multiple Databases!?!?!? Ideas on a postcard please.
So split your registry settings by web site... :->

Now:  <Root>\Software\<Company>\<Product>
                Database Connection="..."
Instead: <Root>\Software\<Company>\<Product>\<Website>
                Database Connection="..."

If nothing else, you can put the value of <Website> in your Global.asa.

HTH,
Tore.


Quote:

> Hi,

> We've built a multi tiered (xml based) framework that we use to build and
> run our web sites.  For the past 2 years we've always run off one database
> source but now want to use more.  That is if you got to one website it
will
> go to one database and if you go to a different web site using the same
> framework we can make it go to a different database.  The problem we've
got
> is that we've created a database wrapper which reads from the registry the
> database details (not pwd info), creates and returns a connection up to
the
> Data Access Layer components.  This works a treat except that we now need
> some way to tell the Database wrapper which database to look at.  The
> obvious thing is to simply have an extra parameter on the database wrapper
> method BUT we only know which which website is being called (i.e. and
which
> database to look at) from the ASP pages but this would mean doing
something
> like:

> ASP (UI layer)
>     Dim oBizPlugIn
>     Set oBizplugIn = Server.createobject(progid)

>     oBizPlugIn.doSomeStuff("USETHISDATASOURCE", .. some other params)
>     Set oBizPlugIn = Nothing

>     This would then call the Business objects which would then call the
Data
> Access Layer which would then call the Database wrapper to finally execute
> the call.

> In a layered approach, the UI Layer, Business Layer and even the Data
Layers
> shouldn't really know what database to use (it's only the database
wrapper)
> but I can't see anyway of doing this cleanly other than the ASP telling
the
> database wrapper what to do but that would mean passing the datasource (or
> some sort of key) info from the ASP pages all the way down.  They're got
to
> be a cleaner approach than this .. sadly I can't think of one at this time
> ..

> Many thanks for your time.



Tue, 04 May 2004 14:51:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP! Multiple Databases/Multiple Servers Access

2. Linking to multiple tables in multiple databases

3. DATAbase Printing PLEASE, PLEASE Help me - please?

4. DATAbase Printing - PLEASE, PLEASE Help me - please?

5. Postcard

6. DataReport and Images on Postcard

7. Re postcard for help..have answer..Thanks

8. postcard for help..thanks fo help..almost there

9. Will send postcard for help!

10. Web Postcards

11. Postcards, envelopes, labels with runtine adjustments

12. Making code wait (any Idea's please)

 

 
Powered by phpBB® Forum Software