BadgerByte
Well-known member
Hi,
I have created an application which currently uses an access mdb as a datastore, however the access mdb becomes unpractical when used in a multi user environment. I want the application to be able to use two different types of datasource, access and msde/SQL Server. The Data access layer is encapsulated in a component 'dbaccess' which holds update/insert/delete functions as well as shared events etc. Now (not thinking ahead too much ) I created a second DAL for SQL server 'dbsql' mimicing the exact same functions/subs/events as dbaccess with a view to switching the component used by my classes for data access. For example, a form ViewEmployees would contain:
Private Withevents mydb as New dbaccess
and all calls to the database will be made through mydb.
The question is, can anyone think of a way I can switch the type of 'mydb' at runtime? Or must I have one DAL component which can cope with both situations?
I hope I haven't lost you here, difficult one to explain!
Many thanks if you've read this.
I have created an application which currently uses an access mdb as a datastore, however the access mdb becomes unpractical when used in a multi user environment. I want the application to be able to use two different types of datasource, access and msde/SQL Server. The Data access layer is encapsulated in a component 'dbaccess' which holds update/insert/delete functions as well as shared events etc. Now (not thinking ahead too much ) I created a second DAL for SQL server 'dbsql' mimicing the exact same functions/subs/events as dbaccess with a view to switching the component used by my classes for data access. For example, a form ViewEmployees would contain:
Private Withevents mydb as New dbaccess
and all calls to the database will be made through mydb.
The question is, can anyone think of a way I can switch the type of 'mydb' at runtime? Or must I have one DAL component which can cope with both situations?
I hope I haven't lost you here, difficult one to explain!
Many thanks if you've read this.