慕慕森
config.php文件'LOAD_EXT_CONFIG' =>'db,db_config',// 加载扩展配置文件。多个文件用逗号分隔//其中db.php中放置的是mysql的配置//db_config放置的是sqlserver的配置其中db.php内容如下return array('DB_TYPE'=>'mysql','DB_HOST'=>'localhost','DB_NAME'=>'your_mysql_dbname','DB_USER'=>'your_mysql_user_name','DB_PWD'=>'123456','DB_PORT'=>'3306','DB_PREFIX'=>'',);db_config.php内容如下return array('DB_CONFIG1' => array('db_type' => 'pdo','db_user' => 'XX','db_pwd' => 'XXXXXXXX','DB_DSN' => 'sqlsrv:Server=XXXXXX;Database=XXXX',),);3在Lib/Model下新建一个专门的模型class SqlsrvModel extends Model {protected $connection = 'DB_CONFIG1';}4愉快地在Action中调各个模型了