I got it working in the browser but not in the cli
>> model emp
exception 'CDbException' with message 'CDbConnection does not support reading schema for odbc database.' in D:\webroot\yii\framework\db\CDbConnection.php:399
I can live with that, I’ve used:
odbc:Driver={SQL Server Native Client 10.0};Server=ServerName\\Instance;Database=testdb;
rricardo, if ODBC is working but not mssql directly, I’ll bet your PHP PDO doesn’t have mssql enabled. If you fix that, it would likely correct your cli issue
Maximum execution time of 60 seconds exceeded in D:\webroot\yii\framework\db\CDbConnection.php on line 0
and in cli:
exception 'CDbException' with message 'CDbConnection failed to open the DB connection:
SQLSTATE[01002] Unable to connect: SQL Server is unavailable or does not exist.
Specified SQL server not found. (severity 9)' in D:\webroot\yii\framework\db\CDbConnection.php:262
rricardo, why not instead try a SQLite instance? just so you can get developing.
You’re running PHP on your localmachine currently, right? So when you’re ready to go to the actual server, you can then change to mssql (as it’ll likely work better in php on linux than on windows, as the windows mssql driver is iffy per php.net).
intel352, thank you for your support. Actually because is an integration to an Enterprise ERP, I do prefer to fight with sql server. I went back to Codeigniter and it is running well. I hope to be here soon.
Hi rricardo! I’m sorry but can you give me steps on how to connect Codeigniter to Sql Server 2005 with ODBC? Because it keeps failing when I tried whereas I already followed steps from other forums, and from there I can summarize that:
change the dbdriver in application/config/database.php to odbc
remove apostrophes around the table names in _from_tables($tables)function in system/database/drivers/odbc/odbc_driver.php
The error is:
Unable to connect to your database server using the provided settings.
Filename: C:\wamp\www\ci\system\database\DB_driver.php
Line Number: 124