App that connects to *either* SQL Server *or* MS Access

Posts   
 
    
elixirsol
User
Posts: 2
Joined: 21-Jul-2009
# Posted on: 21-Jul-2009 18:39:08   

Hiya,

just downloaded the 30 day trial, so please forgive the "noob"-iness of the question! flushed

I'll shortly be re-writing a desktop application where I work. The current app can be configured to use either SQL Server OR Access as its database.

I am wondering whether anyone has any advice on how to best use LLBLGen Pro (or indeed tips on the app design itself), given that the possibility of changing the data source at runtime(changing DBs, after app install, would be a pretty rare occurence, but it does happen).

Any help would be appreciated!!

Thanks,

Gareth

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 21-Jul-2009 21:32:36   

1) Use Adapter, not self servicing. 2) Use Adapter, not self servicing. 3) Use Adapter, not self servicing.

This is important...simple_smile

4) Make sure the schemas of your databases are identical.

Other than that it is actually quite simple. You need to design your LLBLGen project against one of the databases (SQL Server), and generate the code from that.

You then design another LLBLGen project against the other database (Access), and generate the code for that one as well.

This gives you 4 projects - SQL Server DBSpecific and DBGeneric, and Access DBSpecific and DBGeneric.

You then use only one of the DBGeneric projects (the clue is in the name - as they were generated from identical schemas they are pretty much identical) and build some system to provide a DataAccessAdapter component from the DBSpecific project from the database that is currently being used.

Once you actually buy the product there is a download available which will convert a SQL server project to an Access one to save you the step of having to maintain the second project against the Access database.

Have a search on the forums for "multiple database", there are plenty of threads on here giving much more detail.

Matt

elixirsol
User
Posts: 2
Joined: 21-Jul-2009
# Posted on: 22-Jul-2009 10:11:54   

MTrinder wrote:

1) Use Adapter, not self servicing. 2) Use Adapter, not self servicing. 3) Use Adapter, not self servicing.

This is important...simple_smile

4) Make sure the schemas of your databases are identical.

Other than that it is actually quite simple. You need to design your LLBLGen project against one of the databases (SQL Server), and generate the code from that.

You then design another LLBLGen project against the other database (Access), and generate the code for that one as well.

This gives you 4 projects - SQL Server DBSpecific and DBGeneric, and Access DBSpecific and DBGeneric.

You then use only one of the DBGeneric projects (the clue is in the name - as they were generated from identical schemas they are pretty much identical) and build some system to provide a DataAccessAdapter component from the DBSpecific project from the database that is currently being used.

Once you actually buy the product there is a download available which will convert a SQL server project to an Access one to save you the step of having to maintain the second project against the Access database.

Have a search on the forums for "multiple database", there are plenty of threads on here giving much more detail.

Matt

Matt, thanks very much for your reply - I will give it a go! simple_smile

[Now, the only bit I'm not completely clear on is whether to use Adaptor, or self servicing... wink ]

Cheers, Gareth

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 22-Jul-2009 10:50:54   

smile