修改DBType,增加OleDb。
enum DBType { OleDb, SqlServer, SqlServerCE, MySql, PostgreSQL, Oracle, SQLite }
修改CommonConstruct,增加if (dbtype.StartsWith("OleDb")) _dbType = DBType.OleDb;
private void CommonConstruct() { if (dbtype.StartsWith("OleDb")) _dbType = DBType.OleDb; else if (dbtype.StartsWith("MySql")) _dbType = DBType.MySql; else if (dbtype.StartsWith("SqlCe")) _dbType = DBType.SqlServerCE; else if (dbtype.StartsWith("Npgsql")) _dbType = DBType.PostgreSQL; else if (dbtype.StartsWith("Oracle")) _dbType = DBType.Oracle; else if (dbtype.StartsWith("SQLite")) _dbType = DBType.SQLite; else if (dbtype.StartsWith("System.Data.SqlClient.")) _dbType = DBType.SqlServer; }
调用:
Dim db As Database = New Database(cs, "System.Data.OleDb")