CDbException
CDbConnection failed to open the DB connection: [08001][Microsoft][SQL Server Native Client 10.0]SQL Server Network Interfaces: Connection string is not valid [87].
I’m sure that the server is accessible, this code is working :
$connectionInfo = array(
'Database'=>$myDB,
'UID'=>$myUser,
'PWD'=>$myPass,
);
$dbhandle = sqlsrv_connect($myServer, $connectionInfo)
or die("Couldn't connect to SQL Server on $myServer : <br />".print_r(sqlsrv_errors(), true));
$query = sqlsrv_query($dbhandle, 'SELECT * FROM myTable');
while($obj = sqlsrv_fetch_object($query))
echo $obj->name.'<br />';
I use the sqlsrv because the mssql is not longer supported by php 5.3.0. Is it possible to use sqlsrv with Yii ?
[size="2"]I want to create model using gii and error display as below. Please help[/size]
[size="2"]
CDbConnection failed to open the DB connection: could not find driver
/var/www/html/yii-1.1.14.f0fee9/framework/gii/generators/model/ModelCode.php(60)
public function init()
{
if(Yii::app()->{$this->connectionId}===null)
throw new CHttpException(500,'A valid database connection is required to run this generator.');
$this->tablePrefix=Yii::app()->{$this->connectionId}->tablePrefix;
parent::init();
}
CDbCommand falló al ejecutar la sentencia SQL: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘pbis_meta.pbi_security_user’ doesn’t exist. The SQL statement executed was: SELECT * FROM pbis_meta.PBI_SECURITY_USER
what’s happend?
How can I know if the connectionString is wrong or not?