private void createDatabaseAndSaveConnectionString() { _connectionString = DatabaseBuilder.ConnectionStringPrefix + DatabaseBuilder.BuildAccessDb4o(); logger.Info("connection String : " + _connectionString); DbConfig.SaveConnectionString(_connectionString); logger.Info("the connection String is resetted"); }
public void CheckDatabase() { logger.Info("begin check database"); if (strUtil.IsNullOrEmpty(_connectionString)) { logger.Info("connection String is empty. begin to create access database and set connection string"); createDatabaseAndSaveConnectionString(); } else { String connectionItem = DataFactory.GetDialect(DatabaseType.Access).GetConnectionItem(_connectionString, ConnectionItemType.Database); if (strUtil.IsNullOrEmpty(connectionItem)) { logger.Info("connection String is found, but database is empty. begin to create access database and set connection string"); createDatabaseAndSaveConnectionString(); } else if (!File.Exists(connectionItem)) { logger.Info("ConnectionString:" + _connectionString); logger.Info("the database [" + connectionItem + "] is not found. begin to create access database and set connection string"); DatabaseBuilder.BuildAccessDb4o(connectionItem); } } }