Problem
We have current 3 database types, SQLiteDatase, PostgreSQLDatabase and MySQLDatabase.
Many of the methods are the same for each database.
The problem I have that I need to check all the time which database is used.
Select Case DbType
Case 0 # SQLiteDatabase
rs = DbS.SelectSQL(TheSQLQuery.Trim())
Case 1 # PostgreSQLDatabase
rs = DbP.SelectSQL(TheSQLQuery.Trim())
Case 2 # MySQLDatabase
rs = DbM.SelectSQL(TheSQLQuery.Trim())
End Select
If I could assign DbS, DbP or DbM to the class Database (property mDb) when connecting to the database it is only there where it is needed to check what database is used.
Select Case DbType
Case 0 # SQLiteDatabase
mDb = DbS
Case 1 # PostgreSQLDatabase
mDb = DbP
Case 2 # MySQLDatabase
mDb = DbM
End Select
Above would become very simple
rs = mDb.SelectSQL(TheSQLQuery.Trim)
Proposed Solution
Add Database as class for subclasses SQLiteDatabase, PostgreSQLDatabase and MySQLDatabase
Example Workflow
Alternatives Considered
Who Would This Help?
All that use multiple databases