One App, Different Connection String Per User

Posts   
 
    
Mephyston
User
Posts: 6
Joined: 26-Jul-2006
# Posted on: 26-Jul-2006 12:32:52   

Hi,

First, sorry for my english... i'm french ;-)

My problem :

I work on LLBLGEN 2.0 and i'm a neewbie wink

I have one Web Application. On this application, i'd like to create a login page where each user could select the db he would connect to.

For exemple, User1 is using the Production Database, User2 is using the Testing Database, User3 on another Database,...

In fact : One App/Multiple Connection String

My Questions :

  • Is it possible ?
  • If yes, is Adapter Template the best way to do this ?
  • Is the solutions in the "DataAccessAdapter.vb" file ?
  • Did you unterstand me ?stuck_out_tongue_winking_eye

Thx for help

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 26-Jul-2006 14:20:16   

Yes it is possible and your perfectly understandable.

You should be using the Adapter, and here is how I would suggest you may do it:

1- Store the user selected connectionString in the Session object. 2- Whenever you use the DataAccessAdapter for database transactions, pass the connectionString retrieved from the Session to the DataAccessAdapter constructor or the ConnectionString property.

Mephyston
User
Posts: 6
Joined: 26-Jul-2006
# Posted on: 26-Jul-2006 15:45:07   

Perfect smile

So, I have another question now.

I'm working with Oracle. As you know, users can select the db they want connect to.

But the connection string generated by LLBLGEN PRO do not contain the name of the schema, but only the name of the serveur and the catalog.

My question is : how can I specify the name of the schema selected by the user, in the connection string that I have to use with the DataAccesAdapter() constructor ?

Indeed, my Oracle server contains databases which potentially contain different schemas which can all be selected by users.

I hope I'm understandable disappointed

Thx

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 26-Jul-2006 16:24:29   

Use schema name overwriting. See the DataAccessAdapter functionality in Using the generated code -> Adapter -> DataAccessAdapter functionality.

Frans Bouma | Lead developer LLBLGen Pro