Recently I wrote a database application. I decided to connect to a mySQL database and use it.
I decided to use the MySQLCommunityServer class.
All the while thinking to myself that I should use the database class.
Thinking if I wanted to expand then all I would have to do is to make a select statement based on a user preference.
dim db as Database const TheActualDatabase as string = "MySQLCommunityServer" Select Case TheActualDatabase Case "MSSQLServerDatabase" db = new MSSQLServerDatabase Case "MySQLCommunityServer" db = new MySQLCommunityServer Case "ODBCDatabase" db = new ODBCDatabase Case "OracleDatabase" db = new OracleDatabase Case "PostgreSQLDatabase" db = new PostgreSQLDatabase Case "SQLiteDatabase" db = new SQLiteDatabase Else MsgBox("42") End Select if db.connect connect then end if
I was under the impression that there was a database interface and a way to pass an interface to an object.
I looked for the DatabaseInterface but couldn't find it.